de.hpi.fgis.dude.util.data.json.auto
Class ArrayJsonSerialization<E>

java.lang.Object
  extended by de.hpi.fgis.dude.util.data.json.auto.AutoJsonSerialization<Object>
      extended by de.hpi.fgis.dude.util.data.json.auto.ArrayJsonSerialization<E>
Type Parameters:
E - the element type of the array

 class ArrayJsonSerialization<E>
extends AutoJsonSerialization<Object>

Json serialization for arrays.

Author:
Arvid.Heise

Constructor Summary
ArrayJsonSerialization(BoundType type)
          Initializes the serialization for the given array type.
 
Method Summary
 Object 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, Object jsonable)
          Writes the given instance to the specified DuDeJsonGenerator.
 
Methods inherited from class de.hpi.fgis.dude.util.data.json.auto.AutoJsonSerialization
finishTypeSerializationRead, getRawType, getType, isInstantiable, read, readFields, readSerializedType, writeFields, writeWithType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayJsonSerialization

ArrayJsonSerialization(BoundType type)
Initializes the serialization for the given array type.

Parameters:
type - the wrapped type of the array
Method Detail

read

public Object read(DuDeJsonParser<?> parser,
                   Object currentValue)
            throws org.codehaus.jackson.JsonParseException,
                   IOException
Description copied from class: AutoJsonSerialization
Creates an instance of the wrapped type and initializes the content with the json provided by the given 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.

Specified by:
read in class AutoJsonSerialization<Object>
Parameters:
parser - the parser to read from
currentValue - the current value of the field which should be populated by the result of this method or null if this is the root object
Returns:
an instance of T
Throws:
org.codehaus.jackson.JsonParseException - If an error occurred while parsing the data.
IOException - If an error occurred while reading from the stream.

write

public void write(DuDeJsonGenerator generator,
                  Object jsonable)
           throws org.codehaus.jackson.JsonGenerationException,
                  IOException
Description copied from class: AutoJsonSerialization
Writes the given instance to the specified DuDeJsonGenerator.

Specified by:
write in class AutoJsonSerialization<Object>
Parameters:
generator - the generator to write to
jsonable - the jsonable to write
Throws:
org.codehaus.jackson.JsonGenerationException - If an error occurs while generating the Json syntax.
IOException - If an error occurs while accessing the underlying stream.


Copyright © 2011 Hasso Plattner Institute - Chair of Information Systems. All Rights Reserved.