org.apache.camel.dataformat.castor
Class AbstractCastorDataFormat

java.lang.Object
  extended by org.apache.camel.dataformat.castor.AbstractCastorDataFormat
All Implemented Interfaces:
org.apache.camel.spi.DataFormat
Direct Known Subclasses:
CastorDataFormat

public abstract class AbstractCastorDataFormat
extends Object
implements org.apache.camel.spi.DataFormat

An abstract class which implement data format (DataFormat) interface which leverage the Castor library for XML marshaling and unmarshaling

Version:
$Revision$

Field Summary
static String DEFAULT_ENCODING
          The default encoding used for stream access.
 
Constructor Summary
AbstractCastorDataFormat()
           
AbstractCastorDataFormat(org.exolab.castor.xml.XMLContext xmlContext)
           
 
Method Summary
 String[] getClassNames()
           
 String getEncoding()
           
 String getMappingFile()
           
 org.exolab.castor.xml.Marshaller getMarshaller(org.apache.camel.Exchange exchange)
           
 String[] getPackages()
           
 org.exolab.castor.xml.Unmarshaller getUnmarshaller(org.apache.camel.Exchange exchange)
           
 org.exolab.castor.xml.XMLContext getXmlContext(org.apache.camel.spi.ClassResolver resolver)
           
 boolean isValidation()
           
 void marshal(org.apache.camel.Exchange exchange, Object body, OutputStream outputStream)
           
 void setClassNames(String[] classNames)
           
 void setEncoding(String encoding)
           
 void setMappingFile(String mappingFile)
           
 void setMarshaller(org.exolab.castor.xml.Marshaller marshaller)
           
 void setPackages(String[] packages)
           
 void setUnmarshaller(org.exolab.castor.xml.Unmarshaller unmarshaller)
           
 void setValidation(boolean validation)
           
 void setXmlContext(org.exolab.castor.xml.XMLContext xmlContext)
           
 Object unmarshal(org.apache.camel.Exchange exchange, InputStream inputStream)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_ENCODING

public static final String DEFAULT_ENCODING
The default encoding used for stream access.

See Also:
Constant Field Values
Constructor Detail

AbstractCastorDataFormat

public AbstractCastorDataFormat()

AbstractCastorDataFormat

public AbstractCastorDataFormat(org.exolab.castor.xml.XMLContext xmlContext)
Method Detail

marshal

public void marshal(org.apache.camel.Exchange exchange,
                    Object body,
                    OutputStream outputStream)
             throws Exception
Specified by:
marshal in interface org.apache.camel.spi.DataFormat
Throws:
Exception

unmarshal

public Object unmarshal(org.apache.camel.Exchange exchange,
                        InputStream inputStream)
                 throws Exception
Specified by:
unmarshal in interface org.apache.camel.spi.DataFormat
Throws:
Exception

getXmlContext

public org.exolab.castor.xml.XMLContext getXmlContext(org.apache.camel.spi.ClassResolver resolver)
                                               throws Exception
Throws:
Exception

getUnmarshaller

public org.exolab.castor.xml.Unmarshaller getUnmarshaller(org.apache.camel.Exchange exchange)
                                                   throws Exception
Throws:
Exception

getMarshaller

public org.exolab.castor.xml.Marshaller getMarshaller(org.apache.camel.Exchange exchange)
                                               throws Exception
Throws:
Exception

setXmlContext

public void setXmlContext(org.exolab.castor.xml.XMLContext xmlContext)

getMappingFile

public String getMappingFile()

setMappingFile

public void setMappingFile(String mappingFile)

setMarshaller

public void setMarshaller(org.exolab.castor.xml.Marshaller marshaller)

setUnmarshaller

public void setUnmarshaller(org.exolab.castor.xml.Unmarshaller unmarshaller)

getClassNames

public String[] getClassNames()

setClassNames

public void setClassNames(String[] classNames)

getPackages

public String[] getPackages()

setPackages

public void setPackages(String[] packages)

getEncoding

public String getEncoding()

setEncoding

public void setEncoding(String encoding)

isValidation

public boolean isValidation()

setValidation

public void setValidation(boolean validation)


Apache CAMEL