/** * Helper method that calls necessary visit method(s) to indicate that the * underlying JSON type is JSON Integer number, but that there is also a further * format restriction involved. * * @since 2.7 */ protected void visitIntFormat(JsonFormatVisitorWrapper visitor, JavaType typeHint, NumberType numberType, JsonValueFormat format) throws JsonMappingException { JsonIntegerFormatVisitor v2 = visitor.expectIntegerFormat(typeHint); if (v2 != null) { if (numberType != null) { v2.numberType(numberType); } if (format != null) { v2.format(format); } } }
@Override protected void _acceptTimestampVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException { JsonIntegerFormatVisitor v2 = visitor.expectIntegerFormat(typeHint); if (v2 != null) { v2.numberType(JsonParser.NumberType.LONG); SerializerProvider provider = visitor.getProvider(); if ((provider != null) && useNanoseconds(provider)) { // big number, no more specific qualifier to use... } else { // otherwise good old Unix timestamp, in milliseconds v2.format(JsonValueFormat.UTC_MILLISEC); } } }
if (v2 != null) { v2.numberType(JsonParser.NumberType.LONG); v2.format(JsonValueFormat.UTC_MILLISEC);
/** * Helper method that calls necessary visit method(s) to indicate that the * underlying JSON type is JSON Integer number, but that there is also a further * format restriction involved. * * @since 2.7 */ protected void visitIntFormat(JsonFormatVisitorWrapper visitor, JavaType typeHint, NumberType numberType, JsonValueFormat format) throws JsonMappingException { if (visitor != null) { JsonIntegerFormatVisitor v2 = visitor.expectIntegerFormat(typeHint); if (v2 != null) { if (numberType != null) { v2.numberType(numberType); } if (format != null) { v2.format(format); } } } }
/** * Helper method that calls necessary visit method(s) to indicate that the * underlying JSON type is JSON Integer number, but that there is also a further * format restriction involved. * * @since 2.7 */ protected void visitIntFormat(JsonFormatVisitorWrapper visitor, JavaType typeHint, NumberType numberType, JsonValueFormat format) throws JsonMappingException { JsonIntegerFormatVisitor v2 = visitor.expectIntegerFormat(typeHint); if (v2 != null) { if (numberType != null) { v2.numberType(numberType); } if (format != null) { v2.format(format); } } }
@Override protected void _acceptTimestampVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException { JsonIntegerFormatVisitor v2 = visitor.expectIntegerFormat(typeHint); if (v2 != null) { v2.numberType(JsonParser.NumberType.LONG); SerializerProvider provider = visitor.getProvider(); if ((provider != null) && provider.isEnabled(SerializationFeature.WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS)) { // big number, no more specific qualifier to use... } else { // otherwise good old Unix timestamp, in milliseconds v2.format(JsonValueFormat.UTC_MILLISEC); } } } }
@Override protected void _acceptTimestampVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException { JsonIntegerFormatVisitor v2 = visitor.expectIntegerFormat(typeHint); if (v2 != null) { v2.numberType(JsonParser.NumberType.LONG); SerializerProvider provider = visitor.getProvider(); if ((provider != null) && provider.isEnabled(SerializationFeature.WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS)) { // big number, no more specific qualifier to use... } else { // otherwise good old Unix timestamp, in milliseconds v2.format(JsonValueFormat.UTC_MILLISEC); } } } }
protected void _acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint, boolean asNumber) throws JsonMappingException { if (asNumber) { JsonIntegerFormatVisitor v2 = visitor.expectIntegerFormat(typeHint); if (v2 != null) { v2.numberType(JsonParser.NumberType.LONG); v2.format(JsonValueFormat.UTC_MILLISEC); } } else { JsonStringFormatVisitor v2 = visitor.expectStringFormat(typeHint); if (v2 != null) { v2.format(JsonValueFormat.DATE_TIME); } } } }
protected void _acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint, boolean asNumber) throws JsonMappingException { if (asNumber) { JsonIntegerFormatVisitor v2 = visitor.expectIntegerFormat(typeHint); if (v2 != null) { v2.numberType(JsonParser.NumberType.LONG); v2.format(JsonValueFormat.UTC_MILLISEC); } } else { JsonStringFormatVisitor v2 = visitor.expectStringFormat(typeHint); if (v2 != null) { v2.format(JsonValueFormat.DATE_TIME); } } } }