Search in sources :

Example 1 with JsonFormatVisitable

use of com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable in project torodb by torodb.

the class DescriptionFactoryWrapper method expectArrayFormat.

@Override
public JsonArrayFormatVisitor expectArrayFormat(JavaType convertedType) {
    final JsonPointer jsonPointer = getJsonPointer();
    return new JsonArrayFormatVisitor.Base(getProvider()) {

        @Override
        public void itemsFormat(JsonFormatVisitable handler, JavaType elementType) throws JsonMappingException {
            SerializerProvider p = getProvider();
            JsonSerializer<Object> s = p.findValueSerializer(elementType);
            s.acceptJsonFormatVisitor(new DescriptionFactoryWrapper(DescriptionFactoryWrapper.this, jsonPointer.append(JsonPointer.valueOf("/<index>")), p), elementType);
        }
    };
}
Also used : JsonFormatVisitable(com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable) JavaType(com.fasterxml.jackson.databind.JavaType) JsonPointer(com.fasterxml.jackson.core.JsonPointer) SerializerProvider(com.fasterxml.jackson.databind.SerializerProvider)

Aggregations

JsonPointer (com.fasterxml.jackson.core.JsonPointer)1 JavaType (com.fasterxml.jackson.databind.JavaType)1 SerializerProvider (com.fasterxml.jackson.databind.SerializerProvider)1 JsonFormatVisitable (com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable)1