|
||||||||||
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<T> de.hpi.fgis.dude.util.data.json.auto.CompositeJsonSerialization<T>
T
- the class to wrappublic class CompositeJsonSerialization<T>
The json serialization support for classes.
Constructor Summary | |
---|---|
CompositeJsonSerialization(BoundType type)
Initializes the serialization with the given type. |
Method Summary | |
---|---|
Map<Field,CompositeJsonSerialization<?>> |
getComplexFields()
Returns the complex fields of the wrapped type. |
Map<Field,Primitive<?>> |
getPrimitiveFields()
Returns the primitive fields of the wrapped type. |
AutoJsonSerialization<? super T> |
getSuperTypeInfo()
Returns the super type json serialization. |
T |
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 |
readFields(DuDeJsonParser<?> parser,
T instance)
Reads all non-transient fields of the jsonable to the DuDeJsonParser . |
void |
write(DuDeJsonGenerator generator,
T jsonable)
Writes the given instance to the specified DuDeJsonGenerator . |
void |
writeFields(DuDeJsonGenerator generator,
Object jsonable)
Writes all non-transient fields of the jsonable to the DuDeJsonGenerator . |
Methods inherited from class de.hpi.fgis.dude.util.data.json.auto.AutoJsonSerialization |
---|
finishTypeSerializationRead, getRawType, getType, isInstantiable, read, readSerializedType, writeWithType |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CompositeJsonSerialization(BoundType type)
type
- the wrapped typeMethod Detail |
---|
public Map<Field,CompositeJsonSerialization<?>> getComplexFields()
public Map<Field,Primitive<?>> getPrimitiveFields()
public AutoJsonSerialization<? super T> getSuperTypeInfo()
public T read(DuDeJsonParser<?> parser, Object currentValue) throws org.codehaus.jackson.JsonParseException, IOException
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<T>
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 readFields(DuDeJsonParser<?> parser, T instance) throws org.codehaus.jackson.JsonParseException, IOException, EOFException
AutoJsonSerialization
DuDeJsonParser
. It expects the given jsonParser to currently have an opened
record and it leaves it open.
readFields
in class AutoJsonSerialization<T>
parser
- the DuDeJsonParser
to read frominstance
- the AutoJsonable
to initialize
org.codehaus.jackson.JsonParseException
- If an error occurred while parsing the data.
IOException
- If an error occurred while reading the data.
EOFException
public void write(DuDeJsonGenerator generator, T jsonable) throws org.codehaus.jackson.JsonGenerationException, IOException
DuDeJsonGenerator
.
write
in class AutoJsonSerialization<T>
generator
- the generator to write tojsonable
- 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.public void writeFields(DuDeJsonGenerator generator, Object jsonable) throws org.codehaus.jackson.JsonGenerationException, IOException
AutoJsonSerialization
DuDeJsonGenerator
. It expects the given jsonGenerator to currently have an
opened record and it leaves it open.
writeFields
in class AutoJsonSerialization<T>
generator
- the DuDeJsonGenerator
to write tojsonable
- the object, the fields of which 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 |