org.idoox.wasp.serialization
Interface Serializer

All Superinterfaces:
java.io.Serializable, Serializer

public interface Serializer
extends Serializer

This class is responsible for serializing an object to an EncodingTokenWriter.

Since:
4.0
Component:
Core

Field Summary
static java.lang.String MECHANISM_TYPE
          JAX-RPC mechanism type.
 
Method Summary
 void grabReferences(java.lang.Object data, SerializationContext context, SerializationChain chain)
          Traverses the graph of java objects (pointed by data) and stores objects that will be serialized into context via SerializationContext.registerReference(...)
 void init(Configurable configurable)
          Initializes the serializer.
 void serialize(EncodingTokenWriter dataWriter, java.lang.Object data, int[] arrayPos, SerializationContext context, SerializationChain chain)
          Serializes the object to the EncodingTokenWriter.
 
Methods inherited from interface javax.xml.rpc.encoding.Serializer
getMechanismType
 

Field Detail

MECHANISM_TYPE

public static final java.lang.String MECHANISM_TYPE
JAX-RPC mechanism type. Every serializer that implements this interface must return this constant as a result of getMechanismType() call.

See Also:
Constant Field Values
Method Detail

serialize

public void serialize(EncodingTokenWriter dataWriter,
                      java.lang.Object data,
                      int[] arrayPos,
                      SerializationContext context,
                      SerializationChain chain)
               throws MessageCreatingException
Serializes the object to the EncodingTokenWriter.

Parameters:
dataWriter - the writer to which the object is serialized
arrayPos - the position of this item in array, or null if the item is not in sparse array
data - the data being serialized
context - drives the serialization process
Throws:
MessageCreatingException - if something goes wrong

grabReferences

public void grabReferences(java.lang.Object data,
                           SerializationContext context,
                           SerializationChain chain)
                    throws MessageCreatingException
Traverses the graph of java objects (pointed by data) and stores objects that will be serialized into context via SerializationContext.registerReference(...)

Parameters:
data - the data being serialized
context - drives the serialization process
Throws:
MessageCreatingException - if something goes wrong

init

public void init(Configurable configurable)
Initializes the serializer. Called anytime before the serializer is used.

Parameters:
configurable - the configurable of the serializer