|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.jackson.map.JsonSerializer<T>
org.codehaus.jackson.map.ser.SerializerBase<Map<?,?>>
org.codehaus.jackson.map.ser.MapSerializer
public class MapSerializer
Standard serializer implementation for serializing {link java.util.Map} types.
Note: about the only configurable setting currently is ability to filter out entries with specified names.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.codehaus.jackson.map.JsonSerializer |
---|
JsonSerializer.None |
Field Summary | |
---|---|
protected HashSet<String> |
_ignoredEntries
Set of entries to omit during serialization, if any |
static MapSerializer |
instance
Default instance that can be used for Map types that have no specific custom annotations. |
Constructor Summary | |
---|---|
protected |
MapSerializer()
|
protected |
MapSerializer(String[] ignoredEntries)
|
Method Summary | |
---|---|
static MapSerializer |
construct(String[] ignoredEntries)
|
JsonNode |
getSchema(SerializerProvider provider,
Type typeHint)
Get the representation of the schema to which this serializer will conform. |
void |
serialize(Map<?,?> value,
JsonGenerator jgen,
SerializerProvider provider)
Method that can be called to ask implementation to serialize values of type this serializer handles. |
protected void |
serializeEntries(Map<?,?> value,
JsonGenerator jgen,
SerializerProvider provider)
Helper method that will write all entries of given non-empty Map |
protected void |
serializeSomeEntries(Map<?,?> value,
JsonGenerator jgen,
SerializerProvider provider,
HashSet<String> ignored)
Helper method that will write all entries of the given non-empty map, except for specified set of ignorable entries, filtered based on entry key. |
Methods inherited from class org.codehaus.jackson.map.ser.SerializerBase |
---|
createObjectNode, createSchemaNode, createSchemaNode, wrapAndThrow, wrapAndThrow |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final MapSerializer instance
protected final HashSet<String> _ignoredEntries
Constructor Detail |
---|
protected MapSerializer()
protected MapSerializer(String[] ignoredEntries)
Method Detail |
---|
public static MapSerializer construct(String[] ignoredEntries)
ignoredEntries
- Array of entry names that are to be filtered on
serialization; null if nonepublic void serialize(Map<?,?> value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonGenerationException
JsonSerializer
serialize
in class SerializerBase<Map<?,?>>
value
- Value to serialize; can not be null.jgen
- Generator used to output resulting Json contentprovider
- Provider that can be used to get serializers for
serializing Objects value contains, if any.
IOException
JsonGenerationException
public JsonNode getSchema(SerializerProvider provider, Type typeHint)
SchemaAware
getSchema
in interface SchemaAware
getSchema
in class SerializerBase<Map<?,?>>
provider
- The serializer provider.typeHint
- A hint about the type.
protected final void serializeEntries(Map<?,?> value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonGenerationException
IOException
JsonGenerationException
protected final void serializeSomeEntries(Map<?,?> value, JsonGenerator jgen, SerializerProvider provider, HashSet<String> ignored) throws IOException, JsonGenerationException
IOException
JsonGenerationException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |