Refine search
protected static void appendQuoted(StringBuilder sb, String content) { sb.append('"'); CharTypes.appendQuoted(sb, content); sb.append('"'); } }
if (!_loadMore()) { _reportInvalidEOF(" in character escape sequence", JsonToken.VALUE_STRING); return _handleUnrecognizedCharacterEscape((char) _decodeCharForError(c)); int digit = CharTypes.charToHex(ch); if (digit < 0) { _reportUnexpectedChar(ch, "expected a hex-digit for character escape sequence");
final int[] escCodes = CharTypes.get7BitOutputEscapes(); final int escCodeCount = escCodes.length; int inPtr = 0; int escCode = escCodes[d]; int length = (escCode < 0) ? _appendNumeric(d, _qbuf) : _appendNamed(escCode, _qbuf);
final int[] codes = CharTypes.getInputCodeComment(); while ((_inputPtr < _inputEnd) || _loadMore()) { int i = (int) _inputBuffer[_inputPtr++] & 0xFF; int code = codes[i]; return; case INT_CR: _skipCR(); return; case '*': // nop for these comments break; case 2: // 2-byte UTF _skipUtf8_2(); break; case 3: // 3-byte UTF
if (ch == INT_APOS && isEnabled(Feature.ALLOW_SINGLE_QUOTES)) { return _parseAposName(); if (!isEnabled(Feature.ALLOW_UNQUOTED_FIELD_NAMES)) { char c = (char) _decodeCharForError(ch); _reportUnexpectedChar(c, "was expecting double-quote to start field name"); final int[] codes = CharTypes.getInputCodeUtf8JsNames();
final int[] codes = CharTypes.getInputCodeComment(); while ((_inputPtr < _inputEnd) || loadMore()) { int i = (int) _inputBuffer[_inputPtr++] & 0xFF; int code = codes[i]; switch (code) { case INT_LF: _skipLF(); return; case INT_CR: _skipCR(); return; case INT_ASTERISK: // nop for these comments
if (ch == INT_APOSTROPHE && isEnabled(Feature.ALLOW_SINGLE_QUOTES)) { return _parseApostropheFieldName(); if (!isEnabled(Feature.ALLOW_UNQUOTED_FIELD_NAMES)) { _reportUnexpectedChar(ch, "was expecting double-quote to start field name"); final int[] codes = CharTypes.getInputCodeUtf8JsNames();
if (!loadMore()) { _reportInvalidEOF(" in character escape sequence"); return _handleUnrecognizedCharacterEscape((char) _decodeCharForError(c)); int digit = CharTypes.charToHex(ch); if (digit < 0) { _reportUnexpectedChar(ch, "expected a hex-digit for character escape sequence");
final int[] escCodes = CharTypes.get7BitOutputEscapes(); int escape = escCodes[ch]; outputPtr = _appendByte(ch, escape, bb, outputPtr); outputBuffer = bb.getCurrentSegment(); continue main; } else { // yes, surrogate pair if (ch > SURR1_LAST) { // must be from first range _illegal(ch); _illegal(ch); ch = _convert(ch, text.charAt(inputPtr++));
int digit = CharTypes.charToHex(ch); int result = digit; digit = CharTypes.charToHex(ch); if (digit >= 0) { result = (result << 4) | digit; ch = (int) _inputBuffer[_inputPtr++]; digit = CharTypes.charToHex(ch); if (digit >= 0) { result = (result << 4) | digit; ch = (int) _inputBuffer[_inputPtr++]; digit = CharTypes.charToHex(ch); if (digit >= 0) { return (result << 4) | digit;
final int[] codes = CharTypes.getInputCodeUtf8JsNames();
/** * Helper method that can be used to get a copy of standard JSON * escape definitions; this is useful when just wanting to slightly * customize definitions. Caller can modify this array as it sees * fit and usually returns modified instance via {@link #getEscapeCodesForAscii} */ public static int[] standardAsciiEscapesForJSON() { int[] esc = CharTypes.get7BitOutputEscapes(); return Arrays.copyOf(esc, esc.length); } }
_reportUnexpectedChar(i, "was expecting double-quote to start field name"); final int[] codes = CharTypes.getInputCodeLatin1JsNames(); final int maxCode = codes.length;
final int[] escCodes = CharTypes.get7BitOutputEscapes(); int escape = escCodes[ch]; outputPtr = _appendByteEscape(ch, escape, byteBuilder, outputPtr); outputBuffer = byteBuilder.getCurrentSegment(); continue main_loop; } else { // yes, surrogate pair if (ch > SURR1_LAST) { // must be from first range _throwIllegalSurrogate(ch); _throwIllegalSurrogate(ch); ch = _convertSurrogate(ch, text.charAt(inputPtr++));
private final void _skipCComment() throws IOException final int[] codes = CharTypes.getInputCodeComment(); int i = _inputData.readUnsignedByte();
final int[] escCodes = CharTypes.get7BitOutputEscapes(); final int escCodeCount = escCodes.length; int inPtr = 0; int length = _appendSingleEscape(escCode, _quoteBuffer); if ((outPtr + length) > outputBuffer.length) { int first = outputBuffer.length - outPtr;
private final void _skipCComment() throws IOException final int[] codes = CharTypes.getInputCodeComment(); while ((_inputPtr < _inputEnd) || _loadMore()) { int i = (int) _inputBuffer[_inputPtr++] & 0xFF; int code = codes[i]; switch (code) { case '*': if (_inputPtr >= _inputEnd && !_loadMore()) { break main_loop; break; case INT_CR: _skipCR(); break; case 2: // 2-byte UTF
if (ch == INT_APOS && isEnabled(JsonReadFeature.ALLOW_SINGLE_QUOTES)) { return _parseAposName(); if (!isEnabled(JsonReadFeature.ALLOW_UNQUOTED_FIELD_NAMES)) { char c = (char) _decodeCharForError(ch); _reportUnexpectedChar(c, "was expecting double-quote to start field name"); final int[] codes = CharTypes.getInputCodeUtf8JsNames();
final int[] codes = CharTypes.getInputCodeComment(); while ((_inputPtr < _inputEnd) || loadMore()) { int i = (int) _inputBuffer[_inputPtr++] & 0xFF; int code = codes[i]; switch (code) { case INT_LF: _skipLF(); return; case INT_CR: _skipCR(); return; case INT_ASTERISK: // nop for these comments
if (ch == INT_APOSTROPHE && isEnabled(Feature.ALLOW_SINGLE_QUOTES)) { return _parseApostropheFieldName(); if (!isEnabled(Feature.ALLOW_UNQUOTED_FIELD_NAMES)) { _reportUnexpectedChar(ch, "was expecting double-quote to start field name"); final int[] codes = CharTypes.getInputCodeUtf8JsNames();