|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.qi4j.spi.value.ValueSerializerAdapter<OutputType>
OutputType
- Implementor output typepublic abstract class ValueSerializerAdapter<OutputType>
Adapter for pull-parsing capable ValueSerializers.
Among Plain values (see ValueSerializer
) some are considered primitives to underlying serialization
mechanisms and by so handed/come without conversion to/from implementations. Primitive values can be one of:
Constructor Summary | |
---|---|
ValueSerializerAdapter()
|
Method Summary | ||
---|---|---|
protected abstract OutputType |
adaptOutput(java.io.OutputStream output)
|
|
protected abstract void |
onArrayEnd(OutputType output)
|
|
protected abstract void |
onArrayStart(OutputType output)
|
|
protected void |
onFieldEnd(OutputType output)
|
|
protected abstract void |
onFieldStart(OutputType output,
java.lang.String fieldName)
|
|
protected abstract void |
onObjectEnd(OutputType output)
|
|
protected abstract void |
onObjectStart(OutputType output)
|
|
protected void |
onSerializationEnd(java.lang.Object object,
OutputType output)
|
|
protected void |
onSerializationStart(java.lang.Object object,
OutputType output)
|
|
protected abstract void |
onValue(OutputType output,
java.lang.Object value)
|
|
protected void |
onValueEnd(OutputType output)
|
|
protected void |
onValueStart(OutputType output)
|
|
protected
|
registerSerializer(java.lang.Class<T> type,
Function<T,java.lang.Object> serializer)
Register a Plain Value type serialization Function. |
|
|
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 ValueSerializerAdapter()
Method Detail |
---|
protected final <T> void registerSerializer(java.lang.Class<T> type, Function<T,java.lang.Object> serializer)
T
- Plain Value parametrized Typetype
- Plain Value Typedeserializer
- Serialization Functionpublic final <T> Function<T,java.lang.String> serialize()
ValueSerializer
serialize
in interface ValueSerializer
T
- the parametrized function input type
public final <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 final 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 final 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 final 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 final 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 failedprotected abstract OutputType adaptOutput(java.io.OutputStream output) throws java.lang.Exception
java.lang.Exception
protected void onSerializationStart(java.lang.Object object, OutputType output) throws java.lang.Exception
java.lang.Exception
protected void onSerializationEnd(java.lang.Object object, OutputType output) throws java.lang.Exception
java.lang.Exception
protected abstract void onArrayStart(OutputType output) throws java.lang.Exception
java.lang.Exception
protected abstract void onArrayEnd(OutputType output) throws java.lang.Exception
java.lang.Exception
protected abstract void onObjectStart(OutputType output) throws java.lang.Exception
java.lang.Exception
protected abstract void onObjectEnd(OutputType output) throws java.lang.Exception
java.lang.Exception
protected abstract void onFieldStart(OutputType output, java.lang.String fieldName) throws java.lang.Exception
java.lang.Exception
protected void onFieldEnd(OutputType output) throws java.lang.Exception
java.lang.Exception
protected void onValueStart(OutputType output) throws java.lang.Exception
java.lang.Exception
protected abstract void onValue(OutputType output, java.lang.Object value) throws java.lang.Exception
java.lang.Exception
protected void onValueEnd(OutputType output) throws java.lang.Exception
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |