org.codehaus.jackson.map.ser
Class ArraySerializers.StringArraySerializer

java.lang.Object
  extended by org.codehaus.jackson.map.JsonSerializer<T>
      extended by org.codehaus.jackson.map.ser.SerializerBase<T>
          extended by org.codehaus.jackson.map.ser.ContainerSerializerBase<T>
              extended by org.codehaus.jackson.map.ser.ArraySerializers.AsArraySerializer<String[]>
                  extended by org.codehaus.jackson.map.ser.ArraySerializers.StringArraySerializer
All Implemented Interfaces:
ResolvableSerializer, SchemaAware
Enclosing class:
ArraySerializers

public static final class ArraySerializers.StringArraySerializer
extends ArraySerializers.AsArraySerializer<String[]>
implements ResolvableSerializer

Standard serializer used for String[] values.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.codehaus.jackson.map.JsonSerializer
JsonSerializer.None
 
Field Summary
protected  JsonSerializer<Object> _elementSerializer
          Value serializer to use, if it's not the standard one (if it is we can optimize serialization a lot)
 
Fields inherited from class org.codehaus.jackson.map.ser.ArraySerializers.AsArraySerializer
_property, _valueTypeSerializer
 
Fields inherited from class org.codehaus.jackson.map.ser.SerializerBase
_handledType
 
Constructor Summary
ArraySerializers.StringArraySerializer(BeanProperty prop)
           
 
Method Summary
 ContainerSerializerBase<?> _withValueTypeSerializer(TypeSerializer vts)
          Strings never add type info; hence, even if type serializer is suggested, we'll ignore it...
 JsonNode getSchema(SerializerProvider provider, Type typeHint)
          Get the representation of the schema to which this serializer will conform.
 void resolve(SerializerProvider provider)
          Need to get callback to resolve value serializer, which may be overridden by custom serializer
 void serializeContents(String[] value, JsonGenerator jgen, SerializerProvider provider)
           
 
Methods inherited from class org.codehaus.jackson.map.ser.ArraySerializers.AsArraySerializer
serialize, serializeWithType
 
Methods inherited from class org.codehaus.jackson.map.ser.ContainerSerializerBase
withValueTypeSerializer
 
Methods inherited from class org.codehaus.jackson.map.ser.SerializerBase
createObjectNode, createSchemaNode, createSchemaNode, handledType, isDefaultSerializer, wrapAndThrow, wrapAndThrow, wrapAndThrow, wrapAndThrow
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_elementSerializer

protected JsonSerializer<Object> _elementSerializer
Value serializer to use, if it's not the standard one (if it is we can optimize serialization a lot)

Since:
1.7
Constructor Detail

ArraySerializers.StringArraySerializer

public ArraySerializers.StringArraySerializer(BeanProperty prop)
Method Detail

_withValueTypeSerializer

public ContainerSerializerBase<?> _withValueTypeSerializer(TypeSerializer vts)
Strings never add type info; hence, even if type serializer is suggested, we'll ignore it...

Specified by:
_withValueTypeSerializer in class ContainerSerializerBase<String[]>

serializeContents

public void serializeContents(String[] value,
                              JsonGenerator jgen,
                              SerializerProvider provider)
                       throws IOException,
                              JsonGenerationException
Specified by:
serializeContents in class ArraySerializers.AsArraySerializer<String[]>
Throws:
IOException
JsonGenerationException

resolve

public void resolve(SerializerProvider provider)
             throws JsonMappingException
Need to get callback to resolve value serializer, which may be overridden by custom serializer

Specified by:
resolve in interface ResolvableSerializer
Parameters:
provider - Provider that has constructed serializer this method is called on.
Throws:
JsonMappingException

getSchema

public JsonNode getSchema(SerializerProvider provider,
                          Type typeHint)
Description copied from interface: SchemaAware
Get the representation of the schema to which this serializer will conform.

Specified by:
getSchema in interface SchemaAware
Specified by:
getSchema in class SerializerBase<String[]>
Parameters:
provider - The serializer provider.
typeHint - A hint about the type.
Returns:
Json-schema for this serializer.