public class OrgJsonValueSerialization extends Object implements ValueSerialization
This class is used internally by the Zest Runtime to provide default ValueSerialization when no ValueSerialization Service is available.
In application code, prefer the use of OrgJsonValueSerializationService
.
ValueSerialization.Formats
ValueSerializer.Options
Constructor and Description |
---|
OrgJsonValueSerialization(Application application,
Module module,
Module valuesModule) |
Modifier and Type | Method and Description |
---|---|
<T> Function2<ValueType,String,T> |
deserialize()
Factory method for an untyped deserialize function.
|
<T> T |
deserialize(Class<?> type,
InputStream input)
Deserialize a value from a state.
|
<T> T |
deserialize(Class<?> type,
String input)
Deserialize a value from a state.
|
<T> Function<String,T> |
deserialize(Class<T> type)
Factory method for a typed deserialize function.
|
<T> Function<String,T> |
deserialize(ValueType valueType)
Factory method for a typed deserialize function.
|
<T> T |
deserialize(ValueType type,
InputStream input)
Deserialize a value from a state.
|
<T> T |
deserialize(ValueType type,
String input)
Deserialize a value from a state.
|
<T> Function<T,String> |
serialize()
Factory method for a serialize function.
|
<T> Function<T,String> |
serialize(boolean includeTypeInfo)
Deprecated.
|
String |
serialize(Object object)
Serialize the state of a value with type information.
|
String |
serialize(Object object,
boolean includeTypeInfo)
Deprecated.
|
void |
serialize(Object object,
OutputStream output)
Serialize the state of a value with type information.
|
void |
serialize(Object object,
OutputStream output,
boolean includeTypeInfo)
Deprecated.
|
<T> Function<T,String> |
serialize(ValueSerializer.Options options)
Factory method for a serialize function.
|
String |
serialize(ValueSerializer.Options options,
Object object)
Serialize the state of a value.
|
void |
serialize(ValueSerializer.Options options,
Object object,
OutputStream output)
Serialize the state of a value.
|
public OrgJsonValueSerialization(Application application, Module module, Module valuesModule)
public <T> Function<T,String> serialize()
ValueSerializer
serialize
in interface ValueSerializer
T
- the parametrized function input typepublic <T> Function<T,String> serialize(ValueSerializer.Options options)
ValueSerializer
serialize
in interface ValueSerializer
T
- the parametrized function input typeoptions
- ValueSerializer Options@Deprecated public <T> Function<T,String> serialize(boolean includeTypeInfo)
ValueSerializer
serialize
in interface ValueSerializer
T
- the parametrized function input typeincludeTypeInfo
- if type information should be included in the outputpublic String serialize(Object object) throws ValueSerializationException
ValueSerializer
serialize
in interface ValueSerializer
object
- an Object to serializeValueSerializationException
- if the Value serialization failedpublic String serialize(ValueSerializer.Options options, Object object) throws ValueSerializationException
ValueSerializer
serialize
in interface ValueSerializer
options
- ValueSerializer Optionsobject
- an Object to serializeValueSerializationException
- if the Value serialization failed@Deprecated public String serialize(Object object, boolean includeTypeInfo) throws ValueSerializationException
ValueSerializer
serialize
in interface ValueSerializer
object
- an Object to serializeincludeTypeInfo
- if type information should be included in the outputValueSerializationException
- if the Value serialization failedpublic void serialize(Object object, OutputStream output) throws ValueSerializationException
ValueSerializer
serialize
in interface ValueSerializer
object
- an Object to serializeoutput
- that will be used as outputValueSerializationException
- if the Value serialization failedpublic void serialize(ValueSerializer.Options options, Object object, OutputStream output) throws ValueSerializationException
ValueSerializer
serialize
in interface ValueSerializer
options
- ValueSerializer Optionsobject
- an Object to serializeoutput
- that will be used as outputValueSerializationException
- if the Value serialization failed@Deprecated public void serialize(Object object, 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 outputValueSerializationException
- if the Value serialization failedpublic <T> Function<String,T> deserialize(Class<T> type)
ValueDeserializer
The returned Function may throw ValueSerializationException
.
deserialize
in interface ValueDeserializer
T
- the parametrized function return typetype
- the value typepublic <T> Function<String,T> deserialize(ValueType valueType)
ValueDeserializer
The returned Function may throw ValueSerializationException
.
deserialize
in interface ValueDeserializer
T
- the parametrized function return typevalueType
- the value typepublic <T> Function2<ValueType,String,T> deserialize()
ValueDeserializer
The returned Function may throw ValueSerializationException
.
deserialize
in interface ValueDeserializer
T
- the parametrized function return typepublic <T> T deserialize(Class<?> type, String input) throws ValueSerializationException
ValueDeserializer
deserialize
in interface ValueDeserializer
T
- the parametrized returned typetype
- the value typeinput
- the stateValueSerializationException
- if the deserialization failedpublic <T> T deserialize(ValueType type, String input) throws ValueSerializationException
ValueDeserializer
deserialize
in interface ValueDeserializer
T
- the parametrized returned typetype
- the value typeinput
- the stateValueSerializationException
- if the deserialization failedpublic <T> T deserialize(Class<?> type, InputStream input) throws ValueSerializationException
ValueDeserializer
deserialize
in interface ValueDeserializer
T
- the parametrized returned typetype
- the value typeinput
- the state streamValueSerializationException
- if the deserialization failedpublic <T> T deserialize(ValueType type, InputStream input) throws ValueSerializationException
ValueDeserializer
deserialize
in interface ValueDeserializer
T
- the parametrized returned typetype
- the value typeinput
- the state streamValueSerializationException
- if the deserialization failed