org.apache.camel.converter.jaxb
Class JaxbDataFormat

java.lang.Object
  extended by org.apache.camel.support.ServiceSupport
      extended by org.apache.camel.converter.jaxb.JaxbDataFormat
All Implemented Interfaces:
org.apache.camel.CamelContextAware, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.DataFormat, org.apache.camel.StatefulService, org.apache.camel.SuspendableService

public class JaxbDataFormat
extends org.apache.camel.support.ServiceSupport
implements org.apache.camel.spi.DataFormat, org.apache.camel.CamelContextAware

A data format (DataFormat) using JAXB2 to marshal to and from XML

Version:

Field Summary
 
Fields inherited from class org.apache.camel.support.ServiceSupport
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
 
Constructor Summary
JaxbDataFormat()
           
JaxbDataFormat(JAXBContext context)
           
JaxbDataFormat(String contextPath)
           
 
Method Summary
protected  JAXBContext createContext()
          Strategy to create JAXB context
protected  Marshaller createMarshaller()
           
static SchemaFactory createSchemaFactory()
           
protected  Unmarshaller createUnmarshaller()
           
protected  void doStart()
           
protected  void doStop()
           
 org.apache.camel.CamelContext getCamelContext()
           
 JAXBContext getContext()
           
 String getContextPath()
           
 String getEncoding()
           
 Map<String,String> getNamespacePrefix()
           
 String getNamespacePrefixRef()
           
 String getPartClass()
           
 QName getPartNamespace()
           
 String getSchema()
           
 SchemaFactory getSchemaFactory()
           
 JaxbXmlStreamWriterWrapper getXmlStreamWriterWrapper()
           
 boolean isFilterNonXmlChars()
           
 boolean isFragment()
           
 boolean isIgnoreJAXBElement()
           
 boolean isPrettyPrint()
           
 void marshal(org.apache.camel.Exchange exchange, Object graph, OutputStream stream)
           
protected  boolean needFiltering(org.apache.camel.Exchange exchange)
           
 void setCamelContext(org.apache.camel.CamelContext camelContext)
           
 void setContext(JAXBContext context)
           
 void setContextPath(String contextPath)
           
 void setEncoding(String encoding)
           
 void setFilterNonXmlChars(boolean filterNonXmlChars)
           
 void setFragment(boolean fragment)
           
 void setIgnoreJAXBElement(boolean flag)
           
 void setNamespacePrefix(Map<String,String> namespacePrefix)
           
 void setNamespacePrefixRef(String namespacePrefixRef)
           
 void setPartClass(String partClass)
           
 void setPartNamespace(QName partNamespace)
           
 void setPrettyPrint(boolean prettyPrint)
           
 void setSchema(String schema)
           
 void setSchemaFactory(SchemaFactory schemaFactory)
           
 void setXmlStreamWriterWrapper(JaxbXmlStreamWriterWrapper xmlStreamWriterWrapper)
           
 Object unmarshal(org.apache.camel.Exchange exchange, InputStream stream)
           
 
Methods inherited from class org.apache.camel.support.ServiceSupport
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, resume, shutdown, start, stop, suspend
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JaxbDataFormat

public JaxbDataFormat()

JaxbDataFormat

public JaxbDataFormat(JAXBContext context)

JaxbDataFormat

public JaxbDataFormat(String contextPath)
Method Detail

marshal

public void marshal(org.apache.camel.Exchange exchange,
                    Object graph,
                    OutputStream stream)
             throws IOException,
                    SAXException
Specified by:
marshal in interface org.apache.camel.spi.DataFormat
Throws:
IOException
SAXException

unmarshal

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

needFiltering

protected boolean needFiltering(org.apache.camel.Exchange exchange)

isIgnoreJAXBElement

public boolean isIgnoreJAXBElement()

setIgnoreJAXBElement

public void setIgnoreJAXBElement(boolean flag)

getContext

public JAXBContext getContext()

setContext

public void setContext(JAXBContext context)

getContextPath

public String getContextPath()

setContextPath

public void setContextPath(String contextPath)

getSchemaFactory

public SchemaFactory getSchemaFactory()

setSchemaFactory

public void setSchemaFactory(SchemaFactory schemaFactory)

getSchema

public String getSchema()

setSchema

public void setSchema(String schema)

isPrettyPrint

public boolean isPrettyPrint()

setPrettyPrint

public void setPrettyPrint(boolean prettyPrint)

isFragment

public boolean isFragment()

setFragment

public void setFragment(boolean fragment)

isFilterNonXmlChars

public boolean isFilterNonXmlChars()

setFilterNonXmlChars

public void setFilterNonXmlChars(boolean filterNonXmlChars)

getEncoding

public String getEncoding()

setEncoding

public void setEncoding(String encoding)

getPartNamespace

public QName getPartNamespace()

setPartNamespace

public void setPartNamespace(QName partNamespace)

getPartClass

public String getPartClass()

setPartClass

public void setPartClass(String partClass)

getNamespacePrefix

public Map<String,String> getNamespacePrefix()

setNamespacePrefix

public void setNamespacePrefix(Map<String,String> namespacePrefix)

getNamespacePrefixRef

public String getNamespacePrefixRef()

setNamespacePrefixRef

public void setNamespacePrefixRef(String namespacePrefixRef)

getCamelContext

public org.apache.camel.CamelContext getCamelContext()
Specified by:
getCamelContext in interface org.apache.camel.CamelContextAware

setCamelContext

public void setCamelContext(org.apache.camel.CamelContext camelContext)
Specified by:
setCamelContext in interface org.apache.camel.CamelContextAware

getXmlStreamWriterWrapper

public JaxbXmlStreamWriterWrapper getXmlStreamWriterWrapper()

setXmlStreamWriterWrapper

public void setXmlStreamWriterWrapper(JaxbXmlStreamWriterWrapper xmlStreamWriterWrapper)

doStart

protected void doStart()
                throws Exception
Specified by:
doStart in class org.apache.camel.support.ServiceSupport
Throws:
Exception

doStop

protected void doStop()
               throws Exception
Specified by:
doStop in class org.apache.camel.support.ServiceSupport
Throws:
Exception

createContext

protected JAXBContext createContext()
                             throws JAXBException
Strategy to create JAXB context

Throws:
JAXBException

createUnmarshaller

protected Unmarshaller createUnmarshaller()
                                   throws JAXBException,
                                          SAXException,
                                          FileNotFoundException,
                                          MalformedURLException
Throws:
JAXBException
SAXException
FileNotFoundException
MalformedURLException

createMarshaller

protected Marshaller createMarshaller()
                               throws JAXBException,
                                      SAXException,
                                      FileNotFoundException,
                                      MalformedURLException
Throws:
JAXBException
SAXException
FileNotFoundException
MalformedURLException

createSchemaFactory

public static SchemaFactory createSchemaFactory()


Apache Camel