Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.fasterxml.jackson.databind.ser.std;
 
 import java.util.*;
 
Intermediate base class for Lists, Collections and Arrays that contain static (non-dynamic) value types.
public abstract class StaticListSerializerBase<T extends Collection<?>>
    extends StdSerializer<T>
    protected StaticListSerializerBase(Class<?> cls) {
        super(clsfalse);
    }
    @Override
    public boolean isEmpty(T value) {
        return (value == null) || (value.size() == 0);
    }
    
    @Override
    public JsonNode getSchema(SerializerProvider providerType typeHint)
    {
        ObjectNode o = createSchemaNode("array"true);
        o.put("items"contentSchema());
        return o;
    }
    
    @Override
    public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitorJavaType typeHint)
    {
    	acceptContentVisitor(visitor.expectArrayFormat(typeHint));
    }
    /*
    /**********************************************************
    /* Abstract methods for sub-classes to implement
    /**********************************************************
     */
    protected abstract JsonNode contentSchema();
    
    protected abstract void acceptContentVisitor(JsonArrayFormatVisitor visitor);    
New to GrepCode? Check out our FAQ X