|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.qi4j.valueserialization.orgjson.OrgJsonValueSerialization
public class OrgJsonValueSerialization
ValueSerialization producing and consuming JSON documents using org.json.
This class is used internally by the Qi4j Runtime to provide default ValueSerialization when no ValueSerialization Service is available.
In application code, prefer the use of OrgJsonValueSerializationService
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.qi4j.api.value.ValueSerialization |
---|
ValueSerialization.Formats |
Constructor Summary | |
---|---|
OrgJsonValueSerialization(Application application,
Module module,
Module valuesModule)
|
Method Summary | ||
---|---|---|
|
deserialize()
Factory method for an untyped deserialize function. |
|
|
deserialize(java.lang.Class<?> type,
java.io.InputStream input)
Deserialize a value from a state. |
|
|
deserialize(java.lang.Class<?> type,
java.lang.String input)
Deserialize a value from a state. |
|
|
deserialize(java.lang.Class<T> type)
Factory method for a typed deserialize function. |
|
|
deserialize(ValueType valueType)
Factory method for a typed deserialize function. |
|
|
deserialize(ValueType type,
java.io.InputStream input)
Deserialize a value from a state. |
|
|
deserialize(ValueType type,
java.lang.String input)
Deserialize a value from a state. |
|
|
serialize()
Factory method for a serialize function. |
|
|
serialize(boolean includeTypeInfo)
Factory method for a serialize function. |
|
java.lang.String |
serialize(java.lang.Object object)
Serialize the state of a value with type information. |
|
java.lang.String |
serialize(java.lang.Object object,
boolean includeTypeInfo)
Serialize the state of a value. |
|
void |
serialize(java.lang.Object object,
java.io.OutputStream output)
Serialize the state of a value with type information. |
|
void |
serialize(java.lang.Object object,
java.io.OutputStream output,
boolean includeTypeInfo)
Serialize the state of a value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OrgJsonValueSerialization(Application application, Module module, Module valuesModule)
Method Detail |
---|
public <T> Function<T,java.lang.String> serialize()
ValueSerializer
serialize
in interface ValueSerializer
T
- the parametrized function input type
public <T> Function<T,java.lang.String> serialize(boolean includeTypeInfo)
ValueSerializer
serialize
in interface ValueSerializer
T
- the parametrized function input typeincludeTypeInfo
- if type information should be included in the output
public java.lang.String serialize(java.lang.Object object) throws ValueSerializationException
ValueSerializer
serialize
in interface ValueSerializer
object
- an Object to serialize
ValueSerializationException
- if the Value serialization failedpublic java.lang.String serialize(java.lang.Object object, boolean includeTypeInfo) throws ValueSerializationException
ValueSerializer
serialize
in interface ValueSerializer
object
- an Object to serializeincludeTypeInfo
- if type information should be included in the output
ValueSerializationException
- if the Value serialization failedpublic void serialize(java.lang.Object object, java.io.OutputStream output) throws ValueSerializationException
ValueSerializer
serialize
in interface ValueSerializer
object
- an Object to serializeoutput
- that will be used as output
ValueSerializationException
- if the Value serialization failedpublic void serialize(java.lang.Object object, java.io.OutputStream output, boolean includeTypeInfo) throws ValueSerializationException
ValueSerializer
serialize
in interface ValueSerializer
object
- an Object to serializeoutput
- that will be used as outputincludeTypeInfo
- if type information should be included in the output
ValueSerializationException
- if the Value serialization failedpublic <T> Function<java.lang.String,T> deserialize(java.lang.Class<T> type)
ValueDeserializer
The returned Function may throw ValueSerializationException
.
deserialize
in interface ValueDeserializer
T
- the parametrized function return typetype
- the value type
public <T> Function<java.lang.String,T> deserialize(ValueType valueType)
ValueDeserializer
The returned Function may throw ValueSerializationException
.
deserialize
in interface ValueDeserializer
T
- the parametrized function return typevalueType
- the value type
public <T> Function2<ValueType,java.lang.String,T> deserialize()
ValueDeserializer
The returned Function may throw ValueSerializationException
.
deserialize
in interface ValueDeserializer
T
- the parametrized function return type
public <T> T deserialize(java.lang.Class<?> type, java.lang.String input) throws ValueSerializationException
ValueDeserializer
deserialize
in interface ValueDeserializer
T
- the parametrized returned typetype
- the value typeinput
- the state
ValueSerializationException
- if the deserialization failedpublic <T> T deserialize(ValueType type, java.lang.String input) throws ValueSerializationException
ValueDeserializer
deserialize
in interface ValueDeserializer
T
- the parametrized returned typetype
- the value typeinput
- the state
ValueSerializationException
- if the deserialization failedpublic <T> T deserialize(java.lang.Class<?> type, java.io.InputStream input) throws ValueSerializationException
ValueDeserializer
deserialize
in interface ValueDeserializer
T
- the parametrized returned typetype
- the value typeinput
- the state stream
ValueSerializationException
- if the deserialization failedpublic <T> T deserialize(ValueType type, java.io.InputStream input) throws ValueSerializationException
ValueDeserializer
deserialize
in interface ValueDeserializer
T
- the parametrized returned typetype
- the value typeinput
- the state stream
ValueSerializationException
- if the deserialization failed
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |