private final void _skipComment() throws IOException, JsonParseException { if (!isEnabled(JsonParser.Feature.ALLOW_COMMENTS)) _reportUnexpectedChar(47, "maybe a (non-standard) comment? (not recognized as one since Feature 'ALLOW_COMMENTS' not enabled for parser)"); if ((this._inputPtr >= this._inputEnd) && (!loadMore())) _reportInvalidEOF(" in a comment"); char[] arrayOfChar = this._inputBuffer; int i = this._inputPtr; this._inputPtr = (i + 1); int j = arrayOfChar[i]; if (j == 47) { _skipCppComment(); return; } if (j == 42) { _skipCComment(); return; } _reportUnexpectedChar(j, "was expecting either '*' or '/' for a comment"); }
private final void _skipComment() throws IOException, JsonParseException { if (!isEnabled(JsonParser.Feature.ALLOW_COMMENTS)) _reportUnexpectedChar(47, "maybe a (non-standard) comment? (not recognized as one since Feature 'ALLOW_COMMENTS' not enabled for parser)"); if ((this._inputPtr >= this._inputEnd) && (!loadMore())) _reportInvalidEOF(" in a comment"); byte[] arrayOfByte = this._inputBuffer; int i = this._inputPtr; this._inputPtr = (i + 1); int j = 0xFF & arrayOfByte[i]; if (j == 47) { _skipCppComment(); return; } if (j == 42) { _skipCComment(); return; } _reportUnexpectedChar(j, "was expecting either '*' or '/' for a comment"); }
private final void _skipComment() { if (!isEnabled(JsonParser.Feature.ALLOW_COMMENTS)) _reportUnexpectedChar(47, "maybe a (non-standard) comment? (not recognized as one since Feature 'ALLOW_COMMENTS' not enabled for parser)"); if ((this._inputPtr >= this._inputEnd) && (!loadMore())) _reportInvalidEOF(" in a comment"); char[] arrayOfChar = this._inputBuffer; int i = this._inputPtr; this._inputPtr = (i + 1); int j = arrayOfChar[i]; if (j == 47) { _skipCppComment(); return; } if (j == 42) { _skipCComment(); return; } _reportUnexpectedChar(j, "was expecting either '*' or '/' for a comment"); }
private final void _skipComment() { if (!isEnabled(JsonParser.Feature.ALLOW_COMMENTS)) _reportUnexpectedChar(47, "maybe a (non-standard) comment? (not recognized as one since Feature 'ALLOW_COMMENTS' not enabled for parser)"); if ((this._inputPtr >= this._inputEnd) && (!loadMore())) _reportInvalidEOF(" in a comment"); byte[] arrayOfByte = this._inputBuffer; int i = this._inputPtr; this._inputPtr = (i + 1); int j = 0xFF & arrayOfByte[i]; if (j == 47) { _skipCppComment(); return; } if (j == 42) { _skipCComment(); return; } _reportUnexpectedChar(j, "was expecting either '*' or '/' for a comment"); }
public void writeTree(JsonGenerator paramJsonGenerator, JsonNode paramJsonNode) throws IOException, JsonProcessingException { SerializationConfig localSerializationConfig = copySerializationConfig(); this._serializerProvider.serializeValue(localSerializationConfig, paramJsonGenerator, paramJsonNode, this._serializerFactory); if (localSerializationConfig.isEnabled(SerializationConfig.Feature.FLUSH_AFTER_WRITE_VALUE)) paramJsonGenerator.flush(); }
public void writeTree(JsonGenerator paramJsonGenerator, JsonNode paramJsonNode, SerializationConfig paramSerializationConfig) throws IOException, JsonProcessingException { this._serializerProvider.serializeValue(paramSerializationConfig, paramJsonGenerator, paramJsonNode, this._serializerFactory); if (paramSerializationConfig.isEnabled(SerializationConfig.Feature.FLUSH_AFTER_WRITE_VALUE)) paramJsonGenerator.flush(); }
public void writeValue(JsonGenerator paramJsonGenerator, Object paramObject) throws IOException, JsonGenerationException, JsonMappingException { SerializationConfig localSerializationConfig = copySerializationConfig(); if ((localSerializationConfig.isEnabled(SerializationConfig.Feature.CLOSE_CLOSEABLE)) && ((paramObject instanceof Closeable))) _writeCloseableValue(paramJsonGenerator, paramObject, localSerializationConfig); do { return; this._serializerProvider.serializeValue(localSerializationConfig, paramJsonGenerator, paramObject, this._serializerFactory); } while (!localSerializationConfig.isEnabled(SerializationConfig.Feature.FLUSH_AFTER_WRITE_VALUE)); paramJsonGenerator.flush(); }
public void writeValue(JsonGenerator paramJsonGenerator, Object paramObject, SerializationConfig paramSerializationConfig) throws IOException, JsonGenerationException, JsonMappingException { if ((paramSerializationConfig.isEnabled(SerializationConfig.Feature.CLOSE_CLOSEABLE)) && ((paramObject instanceof Closeable))) _writeCloseableValue(paramJsonGenerator, paramObject, paramSerializationConfig); do { return; this._serializerProvider.serializeValue(paramSerializationConfig, paramJsonGenerator, paramObject, this._serializerFactory); } while (!paramSerializationConfig.isEnabled(SerializationConfig.Feature.FLUSH_AFTER_WRITE_VALUE)); paramJsonGenerator.flush(); }
protected final JsonToken _handleUnexpectedValue(int paramInt) throws IOException, JsonParseException { switch (paramInt) { default: case 39: case 78: while (true) { _reportUnexpectedChar(paramInt, "expected a valid value (number, String, array, object, 'true', 'false' or 'null')"); return null; if (isEnabled(JsonParser.Feature.ALLOW_SINGLE_QUOTES)) { return _handleApostropheValue(); if (_matchToken("NaN", 1)) { if (isEnabled(JsonParser.Feature.ALLOW_NON_NUMERIC_NUMBERS)) return resetAsNaN("NaN", (0.0D / 0.0D)); _reportError("Non-standard token 'NaN': enable JsonParser.Feature.ALLOW_NON_NUMERIC_NUMBERS to allow"); } char[] arrayOfChar2 = this._inputBuffer; int j = this._inputPtr; this._inputPtr = (j + 1); _reportUnexpectedChar(arrayOfChar2[j], "expected 'NaN' or a valid value"); } } case 43: } if ((this._inputPtr >= this._inputEnd) && (!loadMore())) _reportInvalidEOFInValue(); char[] arrayOfChar1 = this._inputBuffer; int i = this._inputPtr; this._inputPtr = (i + 1); return _handleInvalidNumberStart(arrayOfChar1[i], false); }
public Utf8StreamParser(IOContext paramIOContext, int paramInt1, InputStream paramInputStream, ObjectCodec paramObjectCodec, BytesToNameCanonicalizer paramBytesToNameCanonicalizer, byte[] paramArrayOfByte, int paramInt2, int paramInt3, boolean paramBoolean) { super(paramIOContext, paramInt1, paramInputStream, paramArrayOfByte, paramInt2, paramInt3, paramBoolean); this._objectCodec = paramObjectCodec; this._symbols = paramBytesToNameCanonicalizer; if (!JsonParser.Feature.CANONICALIZE_FIELD_NAMES.enabledIn(paramInt1)) _throwInternal(); }
private final int _verifyNoLeadingZeroes() throws IOException, JsonParseException { if ((this._inputPtr >= this._inputEnd) && (!loadMore())); int i; do { i = 48; while ((this._inputPtr >= this._inputEnd) && (!loadMore())) do { return i; i = 0xFF & this._inputBuffer[this._inputPtr]; if ((i < 48) || (i > 57)) return 48; if (!isEnabled(JsonParser.Feature.ALLOW_NUMERIC_LEADING_ZEROS)) reportInvalidNumber("Leading zeroes not allowed"); this._inputPtr = (1 + this._inputPtr); } while (i != 48); i = 0xFF & this._inputBuffer[this._inputPtr]; if ((i < 48) || (i > 57)) return 48; this._inputPtr = (1 + this._inputPtr); } while (i == 48); return i; }
protected JsonToken _handleUnexpectedValue(int paramInt) throws IOException, JsonParseException { switch (paramInt) { default: case 39: case 78: while (true) { _reportUnexpectedChar(paramInt, "expected a valid value (number, String, array, object, 'true', 'false' or 'null')"); return null; if (isEnabled(JsonParser.Feature.ALLOW_SINGLE_QUOTES)) { return _handleApostropheValue(); if (_matchToken("NaN", 1)) { if (isEnabled(JsonParser.Feature.ALLOW_NON_NUMERIC_NUMBERS)) return resetAsNaN("NaN", (0.0D / 0.0D)); _reportError("Non-standard token 'NaN': enable JsonParser.Feature.ALLOW_NON_NUMERIC_NUMBERS to allow"); } byte[] arrayOfByte2 = this._inputBuffer; int j = this._inputPtr; this._inputPtr = (j + 1); _reportUnexpectedChar(0xFF & arrayOfByte2[j], "expected 'NaN' or a valid value"); } } case 43: } if ((this._inputPtr >= this._inputEnd) && (!loadMore())) _reportInvalidEOFInValue(); byte[] arrayOfByte1 = this._inputBuffer; int i = this._inputPtr; this._inputPtr = (i + 1); return _handleInvalidNumberStart(0xFF & arrayOfByte1[i], false); }
protected void _closeInput() throws IOException { if (this._reader != null) { if ((this._ioContext.isResourceManaged()) || (isEnabled(JsonParser.Feature.AUTO_CLOSE_SOURCE))) this._reader.close(); this._reader = null; } }
public JsonParser constructParser(int paramInt, ObjectCodec paramObjectCodec, BytesToNameCanonicalizer paramBytesToNameCanonicalizer, CharsToNameCanonicalizer paramCharsToNameCanonicalizer) throws IOException, JsonParseException { JsonEncoding localJsonEncoding = detectEncoding(); boolean bool1 = JsonParser.Feature.CANONICALIZE_FIELD_NAMES.enabledIn(paramInt); boolean bool2 = JsonParser.Feature.INTERN_FIELD_NAMES.enabledIn(paramInt); if ((localJsonEncoding == JsonEncoding.UTF8) && (bool1)) { BytesToNameCanonicalizer localBytesToNameCanonicalizer = paramBytesToNameCanonicalizer.makeChild(bool1, bool2); return new Utf8StreamParser(this._context, paramInt, this._in, paramObjectCodec, localBytesToNameCanonicalizer, this._inputBuffer, this._inputPtr, this._inputEnd, this._bufferRecyclable); } return new ReaderBasedParser(this._context, paramInt, constructReader(), paramObjectCodec, paramCharsToNameCanonicalizer.makeChild(bool1, bool2)); }
private final char _verifyNoLeadingZeroes() throws IOException, JsonParseException { if ((this._inputPtr >= this._inputEnd) && (!loadMore())); int i; do { i = 48; while ((this._inputPtr >= this._inputEnd) && (!loadMore())) do { return i; i = this._inputBuffer[this._inputPtr]; if ((i < 48) || (i > 57)) return '0'; if (!isEnabled(JsonParser.Feature.ALLOW_NUMERIC_LEADING_ZEROS)) reportInvalidNumber("Leading zeroes not allowed"); this._inputPtr = (1 + this._inputPtr); } while (i != 48); i = this._inputBuffer[this._inputPtr]; if ((i < 48) || (i > 57)) return '0'; this._inputPtr = (1 + this._inputPtr); } while (i == 48); return i; }
protected char _handleUnrecognizedCharacterEscape(char paramChar) throws JsonProcessingException { if (isEnabled(JsonParser.Feature.ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER)); do return paramChar; while ((paramChar == '\'') && (isEnabled(JsonParser.Feature.ALLOW_SINGLE_QUOTES))); _reportError("Unrecognized character escape " + _getCharDesc(paramChar)); return paramChar; }
protected void _throwUnquotedSpace(int paramInt, String paramString) throws JsonParseException { if ((!isEnabled(JsonParser.Feature.ALLOW_UNQUOTED_CONTROL_CHARS)) || (paramInt >= 32)) { int i = (char)paramInt; _reportError("Illegal unquoted character (" + _getCharDesc(i) + "): has to be escaped using backslash to be included in " + paramString); } }
protected void _closeInput() throws IOException { if (this._inputStream != null) { if ((this._ioContext.isResourceManaged()) || (isEnabled(JsonParser.Feature.AUTO_CLOSE_SOURCE))) this._inputStream.close(); this._inputStream = null; } }
public JacksonSerializer() { objectMapper = new ObjectMapper(); objectMapper.enableDefaultTyping(); // JSON configuration not to serialize null field objectMapper.setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL); // JSON configuration not to throw exception on empty bean class objectMapper.disable(SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS); // JSON configuration for compatibility objectMapper.configure(Feature.ALLOW_UNQUOTED_FIELD_NAMES, true); objectMapper.configure(Feature.ALLOW_UNQUOTED_CONTROL_CHARS, true); }
private final char _verifyNoLeadingZeroes() { if ((this._inputPtr >= this._inputEnd) && (!loadMore())); char c; do { c = '0'; while ((this._inputPtr >= this._inputEnd) && (!loadMore())) do { return c; c = this._inputBuffer[this._inputPtr]; if ((c < '0') || (c > '9')) return '0'; if (!isEnabled(JsonParser.Feature.ALLOW_NUMERIC_LEADING_ZEROS)) reportInvalidNumber("Leading zeroes not allowed"); this._inputPtr = (1 + this._inputPtr); } while (c != '0'); c = this._inputBuffer[this._inputPtr]; if ((c < '0') || (c > '9')) return '0'; this._inputPtr = (1 + this._inputPtr); } while (c == '0'); return c; }
protected final void _closeInput() { if (this._reader != null) { if ((this._ioContext.isResourceManaged()) || (isEnabled(JsonParser.Feature.AUTO_CLOSE_SOURCE))) this._reader.close(); this._reader = null; } }
protected final JsonToken _handleUnexpectedValue(int paramInt) { switch (paramInt) { default: case 39: case 78: while (true) { _reportUnexpectedChar(paramInt, "expected a valid value (number, String, array, object, 'true', 'false' or 'null')"); return null; if (isEnabled(JsonParser.Feature.ALLOW_SINGLE_QUOTES)) { return _handleApostropheValue(); _matchToken("NaN", 1); if (isEnabled(JsonParser.Feature.ALLOW_NON_NUMERIC_NUMBERS)) return resetAsNaN("NaN", (0.0D / 0.0D)); _reportError("Non-standard token 'NaN': enable JsonParser.Feature.ALLOW_NON_NUMERIC_NUMBERS to allow"); } } case 43: } if ((this._inputPtr >= this._inputEnd) && (!loadMore())) _reportInvalidEOFInValue(); char[] arrayOfChar = this._inputBuffer; int i = this._inputPtr; this._inputPtr = (i + 1); return _handleInvalidNumberStart(arrayOfChar[i], false); }
public Utf8StreamParser(IOContext paramIOContext, int paramInt1, InputStream paramInputStream, ObjectCodec paramObjectCodec, BytesToNameCanonicalizer paramBytesToNameCanonicalizer, byte[] paramArrayOfByte, int paramInt2, int paramInt3, boolean paramBoolean) { super(paramIOContext, paramInt1); this._inputStream = paramInputStream; this._objectCodec = paramObjectCodec; this._symbols = paramBytesToNameCanonicalizer; this._inputBuffer = paramArrayOfByte; this._inputPtr = paramInt2; this._inputEnd = paramInt3; this._bufferRecyclable = paramBoolean; if (!JsonParser.Feature.CANONICALIZE_FIELD_NAMES.enabledIn(paramInt1)) _throwInternal(); }
private final int _verifyNoLeadingZeroes() { if ((this._inputPtr >= this._inputEnd) && (!loadMore())); int i; do { i = 48; while ((this._inputPtr >= this._inputEnd) && (!loadMore())) do { return i; i = 0xFF & this._inputBuffer[this._inputPtr]; if ((i < 48) || (i > 57)) return 48; if (!isEnabled(JsonParser.Feature.ALLOW_NUMERIC_LEADING_ZEROS)) reportInvalidNumber("Leading zeroes not allowed"); this._inputPtr = (1 + this._inputPtr); } while (i != 48); i = 0xFF & this._inputBuffer[this._inputPtr]; if ((i < 48) || (i > 57)) return 48; this._inputPtr = (1 + this._inputPtr); } while (i == 48); return i; }