Apache CXF API

org.apache.cxf.aegis.type.encoded
Class TrailingBlocks

java.lang.Object
  extended by org.apache.cxf.aegis.type.encoded.TrailingBlocks

public class TrailingBlocks
extends Object

TrailingBlocks reads and writes the extra objects referenced but not written in the main message parts. These objects are commonly refered to as serialization (SOAP spec) roots and trailing blocks (JaxRpc spec). This class uses ObjectType to perform the actual reading and writting, so each block will (and must) contain an xsi type element.

Typically, all message parts are read or written using the SoapRefType and before closing the SOAP body element the trailing blocks are read or written using this class.


Constructor Summary
TrailingBlocks()
           
TrailingBlocks(ObjectType objectType)
           
TrailingBlocks(TypeMapping typeMapping)
           
 
Method Summary
 ObjectType getObjectType()
          Gets the ObjectType used to read and write the trailing block instances.
 List<Object> readBlocks(MessageReader reader, Context context)
          Reads all remailing elements in the reader and registers them with the SoapRefRegistry in the context.
 void setObjectType(ObjectType objectType)
          Sets the ObjectType used to read and write the trailing block instances.
 List<Object> writeBlocks(MessageWriter writer, Context context)
          Writes all of the unmarshalled objects in the MarshalRegistry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrailingBlocks

public TrailingBlocks()

TrailingBlocks

public TrailingBlocks(TypeMapping typeMapping)

TrailingBlocks

public TrailingBlocks(ObjectType objectType)
Method Detail

getObjectType

public ObjectType getObjectType()
Gets the ObjectType used to read and write the trailing block instances.

Returns:
the ObjectType used to read and write the trailing block instances.

setObjectType

public void setObjectType(ObjectType objectType)
Sets the ObjectType used to read and write the trailing block instances.

Parameters:
objectType - the ObjectType used to read and write the trailing block instances.

readBlocks

public List<Object> readBlocks(MessageReader reader,
                               Context context)
                        throws DatabindingException
Reads all remailing elements in the reader and registers them with the SoapRefRegistry in the context.

Parameters:
reader - the stream to read
context - the unmarshal context
Returns:
a list containing the object instances read
Throws:
DatabindingException - if a trailing block element does not contain a soap id attribute

writeBlocks

public List<Object> writeBlocks(MessageWriter writer,
                                Context context)
Writes all of the unmarshalled objects in the MarshalRegistry.

Parameters:
writer - the stream to write the objects
context - the marshal context
Returns:
a list containing the object instances written

Apache CXF API

Apache CXF