de.hpi.fgis.dude.util.data.json.auto
Class EnumJsonSerialization<E extends Enum<E>>
java.lang.Object
de.hpi.fgis.dude.util.data.json.auto.AutoJsonSerialization<E>
de.hpi.fgis.dude.util.data.json.auto.EnumJsonSerialization<E>
- Type Parameters:
E
- the enum type
class EnumJsonSerialization<E extends Enum<E>>
- extends AutoJsonSerialization<E>
Enum constant serialization.
- Author:
- Arvid.Heise
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EnumJsonSerialization
public EnumJsonSerialization(BoundType enumType)
- Initializes the serialization for the given type.
- Parameters:
enumType
- the wrapped enum type
write
public void write(DuDeJsonGenerator generator,
E 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<E extends Enum<E>>
- Parameters:
generator
- the generator to write tojsonable
- 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.
read
public E 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<E extends Enum<E>>
- Parameters:
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
- 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.
Copyright © 2011 Hasso Plattner Institute - Chair of Information Systems. All Rights Reserved.