|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.hpi.fgis.dude.util.data.json.auto.AutoJsonSerialization<C> de.hpi.fgis.dude.util.data.json.auto.CollectionJsonSerialization<E,C>
E
- the element typeC
- the collection typeclass CollectionJsonSerialization<E,C extends Collection<E>>
Collection json serialization support.
Constructor Summary | |
---|---|
CollectionJsonSerialization(BoundType genericType)
Initializes the json serialization for the given type. |
Method Summary | |
---|---|
C |
read(DuDeJsonParser<?> parser,
Object currentValue)
Creates an instance of the wrapped type and initializes the content with the json provided by the given DuDeJsonParser . |
void |
write(DuDeJsonGenerator generator,
C collection)
Writes the given instance to the specified DuDeJsonGenerator . |
protected void |
writeWithType(DuDeJsonGenerator generator,
C value)
Writes the given value with additional type information. This method should be used when the actual type of a value cannot be inferred from the declaration. The typical scenario is the usage of polymorphism without secondary information which would allow to infer the type. |
Methods inherited from class de.hpi.fgis.dude.util.data.json.auto.AutoJsonSerialization |
---|
finishTypeSerializationRead, getRawType, getType, isInstantiable, read, readFields, readSerializedType, writeFields |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CollectionJsonSerialization(BoundType genericType)
genericType
- the type to wrapMethod Detail |
---|
public C read(DuDeJsonParser<?> parser, Object currentValue) throws org.codehaus.jackson.JsonParseException, IOException
AutoJsonSerialization
DuDeJsonParser
. This method
might reuse the currentValue but should in most cases use the actual type information of the currentValue to create a new instance.
read
in class AutoJsonSerialization<C extends Collection<E>>
parser
- the parser to read fromcurrentValue
- the current value of the field which should be populated by the result of this method or null if this is the root object
T
org.codehaus.jackson.JsonParseException
- If an error occurred while parsing the data.
IOException
- If an error occurred while reading from the stream.public void write(DuDeJsonGenerator generator, C collection) throws org.codehaus.jackson.JsonGenerationException, IOException
AutoJsonSerialization
DuDeJsonGenerator
.
write
in class AutoJsonSerialization<C extends Collection<E>>
generator
- the generator to write tocollection
- the jsonable to write
org.codehaus.jackson.JsonGenerationException
- If an error occurs while generating the Json syntax.
IOException
- If an error occurs while accessing the underlying stream.protected void writeWithType(DuDeJsonGenerator generator, C value) throws org.codehaus.jackson.JsonGenerationException, IOException
AutoJsonSerialization
writeWithType
in class AutoJsonSerialization<C extends Collection<E>>
generator
- the DuDeJsonGenerator
to write tovalue
- the object to write
org.codehaus.jackson.JsonGenerationException
- If an error occurs while generating the Json syntax.
IOException
- If an error occurs while accessing the underlying stream.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |