SwitchYard: Core 0.6.0.Beta2

org.switchyard.serial.format
Class XMLBeanSerializer

java.lang.Object
  extended by org.switchyard.serial.BaseSerializer
      extended by org.switchyard.serial.format.XMLBeanSerializer
All Implemented Interfaces:
Serializer

public final class XMLBeanSerializer
extends BaseSerializer

A JDK serializer that performs FormatType.XML_BEAN serialization/deserialization.

Author:
David Ward <dward@jboss.org> © 2012 Red Hat Inc.

Constructor Summary
XMLBeanSerializer()
          Default constructor.
 
Method Summary
<T> T
deserialize(InputStream in, Class<T> type)
          Deserializes an input stream to an object of a type.
<T> int
serialize(T obj, Class<T> type, OutputStream out)
          Serializes an object of a type to an output stream.
 
Methods inherited from class org.switchyard.serial.BaseSerializer
deserialize, getBufferSize, getCompression, getFormat, isCloseEnabled, isPrettyPrint, serialize, setBufferSize, setCloseEnabled, setPrettyPrint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLBeanSerializer

public XMLBeanSerializer()
Default constructor.

Method Detail

serialize

public <T> int serialize(T obj,
                         Class<T> type,
                         OutputStream out)
              throws IOException
Serializes an object of a type to an output stream.

Type Parameters:
T - the type of object
Parameters:
obj - the object
type - the type
out - the output stream
Returns:
how many bytes were written
Throws:
IOException - something wicked this way comes

deserialize

public <T> T deserialize(InputStream in,
                         Class<T> type)
              throws IOException
Deserializes an input stream to an object of a type.

Type Parameters:
T - the type of object
Parameters:
in - the input stream
type - the type
Returns:
the object
Throws:
IOException - something wicked this way comes

SwitchYard: Core 0.6.0.Beta2

JBoss by Red Hat