Refine search
/** * @since 2.7 */ protected void visitArrayFormat(JsonFormatVisitorWrapper visitor, JavaType typeHint, JsonFormatTypes itemType) throws JsonMappingException { JsonArrayFormatVisitor v2 = visitor.expectArrayFormat(typeHint); if (v2 != null) { v2.itemsFormat(itemType); } }
@Override public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException { JsonArrayFormatVisitor arrayVisitor = visitor.expectArrayFormat(typeHint); if (arrayVisitor != null) { JavaType contentType = _elementType; // [databind#1793]: Was getting `null` for `typeHint`. But why would we even use it... /* TypeFactory tf = visitor.getProvider().getTypeFactory(); contentType = tf.moreSpecificType(_elementType, typeHint.getContentType()); if (contentType == null) { visitor.getProvider().reportBadDefinition(_elementType, "Could not resolve type: "+_elementType); } */ JsonSerializer<?> valueSer = _elementSerializer; if (valueSer == null) { valueSer = visitor.getProvider().findValueSerializer(contentType, _property); } arrayVisitor.itemsFormat(valueSer, contentType); } }
throws JsonMappingException switch (_serializationShape(visitor.getProvider())) { case FORMAT_TIMESTAMP: JsonIntegerFormatVisitor v2 = visitor.expectIntegerFormat(typeHint); if (v2 != null) { v2.numberType(JsonParser.NumberType.LONG); case FORMAT_ARRAY: JsonArrayFormatVisitor v2 = visitor.expectArrayFormat(typeHint); if (v2 != null) { v2.itemsFormat(JsonFormatTypes.INTEGER);
@Override protected void acceptContentVisitor(JsonArrayFormatVisitor visitor) throws JsonMappingException { visitor.itemsFormat(JsonFormatTypes.STRING); }
@Override public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException { JsonArrayFormatVisitor arrayVisitor = (visitor == null) ? null : visitor.expectArrayFormat(typeHint); if (arrayVisitor != null) { /* 01-Sep-2014, tatu: Earlier was trying to make use of 'typeHint' for some * reason, causing NPE (as per https://github.com/FasterXML/jackson-module-jsonSchema/issues/34) * if coupled with `@JsonValue`. But I can't see much benefit of trying to rely * on TypeHint here so code is simplified like so: */ JsonSerializer<?> valueSer = _elementSerializer; if (valueSer == null) { valueSer = visitor.getProvider().findValueSerializer(_elementType, _property); } arrayVisitor.itemsFormat(valueSer, _elementType); } }
@Override protected void acceptContentVisitor(JsonArrayFormatVisitor visitor) throws JsonMappingException { visitor.itemsFormat(JsonFormatTypes.STRING); }
@Override // since 2.9 public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException { // 31-Mar-2017, tatu: Use same type as `ByteArraySerializer`: not optimal but has to do JsonArrayFormatVisitor v2 = visitor.expectArrayFormat(typeHint); if (v2 != null) { v2.itemsFormat(JsonFormatTypes.INTEGER); } } }
@Override public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException { JsonArrayFormatVisitor arrayVisitor = (visitor == null) ? null : visitor.expectArrayFormat(typeHint); if (arrayVisitor != null) { /* 01-Sep-2014, tatu: Earlier was trying to make use of 'typeHint' for some * reason, causing NPE (as per https://github.com/FasterXML/jackson-module-jsonSchema/issues/34) * if coupled with `@JsonValue`. But I can't see much benefit of trying to rely * on TypeHint here so code is simplified like so: */ JsonSerializer<?> valueSer = _elementSerializer; if (valueSer == null) { valueSer = visitor.getProvider().findValueSerializer(_elementType, _property); } arrayVisitor.itemsFormat(valueSer, _elementType); } }
@Override protected void acceptContentVisitor(JsonArrayFormatVisitor visitor) throws JsonMappingException { visitor.itemsFormat(JsonFormatTypes.STRING); }
@Override public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException { // 14-Mar-2016, tatu: while logically (and within JVM) binary, gets encoded as Base64 String, // let's try to indicate it is array of Bytes... difficult, thanks to JSON Schema's // lackluster listing of types // // TODO: for 2.8, make work either as String/base64, or array of numbers, // with a qualifier that can be used to determine it's byte[] JsonArrayFormatVisitor v2 = visitor.expectArrayFormat(typeHint); if (v2 != null) { v2.itemsFormat(JsonFormatTypes.INTEGER); } } }
@Override public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException { JsonArrayFormatVisitor arrayVisitor = visitor.expectArrayFormat(typeHint); if (arrayVisitor != null) { JavaType contentType = _elementType; // [databind#1793]: Was getting `null` for `typeHint`. But why would we even use it... /* TypeFactory tf = visitor.getProvider().getTypeFactory(); contentType = tf.moreSpecificType(_elementType, typeHint.getContentType()); if (contentType == null) { visitor.getProvider().reportBadDefinition(_elementType, "Could not resolve type: "+_elementType); } */ JsonSerializer<?> valueSer = _elementSerializer; if (valueSer == null) { valueSer = visitor.getProvider().findValueSerializer(contentType, _property); } arrayVisitor.itemsFormat(valueSer, contentType); } }
@Override protected void acceptContentVisitor(JsonArrayFormatVisitor visitor) throws JsonMappingException { visitor.itemsFormat(JsonFormatTypes.STRING); }
@Override public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException { if (visitor != null) { JsonArrayFormatVisitor v2 = visitor.expectArrayFormat(typeHint); if (v2 != null) { v2.itemsFormat(JsonFormatTypes.STRING); } } }
JsonArrayFormatVisitor arrayVisitor = visitor.expectArrayFormat(typeHint); JavaType contentType = null; if (typeHint != null) { Type[] typeArgs = ((ParameterizedType) typeHint).getActualTypeArguments(); if (typeArgs.length == 1) { contentType = visitor.getProvider().constructType(typeArgs[0]); arrayVisitor.itemsFormat(contentType);
@Override protected void acceptContentVisitor(JsonArrayFormatVisitor visitor) throws JsonMappingException { visitor.itemsFormat(JsonFormatTypes.STRING); }
protected void _acceptTimestampVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException { // By default, most sub-types use JSON Array, so do this: JsonArrayFormatVisitor v2 = visitor.expectArrayFormat(typeHint); if (v2 != null) { v2.itemsFormat(JsonFormatTypes.INTEGER); } }
@Override public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException { JsonArrayFormatVisitor arrayVisitor = visitor.expectArrayFormat(typeHint); if (arrayVisitor != null) { TypeFactory tf = visitor.getProvider().getTypeFactory(); JavaType contentType = tf.moreSpecificType(_elementType, typeHint.getContentType()); if (contentType == null) { throw JsonMappingException.from(visitor.getProvider(), "Could not resolve type"); } JsonSerializer<?> valueSer = _elementSerializer; if (valueSer == null) { valueSer = visitor.getProvider().findValueSerializer(contentType, _property); } arrayVisitor.itemsFormat(valueSer, contentType); } }
@Override protected void acceptContentVisitor(JsonArrayFormatVisitor visitor) throws JsonMappingException { visitor.itemsFormat(JsonFormatTypes.STRING); }
/** * @since 2.7 */ protected void visitArrayFormat(JsonFormatVisitorWrapper visitor, JavaType typeHint, JsonSerializer<?> itemSerializer, JavaType itemType) throws JsonMappingException { JsonArrayFormatVisitor v2 = visitor.expectArrayFormat(typeHint); if (_neitherNull(v2, itemSerializer)) { v2.itemsFormat(itemSerializer, itemType); } }
@Override public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException { JsonArrayFormatVisitor arrayVisitor = visitor.expectArrayFormat(typeHint); if (arrayVisitor != null) { TypeFactory tf = visitor.getProvider().getTypeFactory(); JavaType contentType = tf.moreSpecificType(_elementType, typeHint.getContentType()); if (contentType == null) { throw new JsonMappingException("Could not resolve type"); } JsonSerializer<?> valueSer = _elementSerializer; if (valueSer == null) { valueSer = visitor.getProvider().findValueSerializer(contentType, _property); } arrayVisitor.itemsFormat(valueSer, contentType); } }