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  Unmarshaller createUnmarshaller()
           
protected  void doStart()
           
protected  void doStop()
           
 org.apache.camel.CamelContext getCamelContext()
           
 JAXBContext getContext()
           
 String getContextPath()
           
 String getEncoding()
           
 String getPartClass()
           
 QName getPartNamespace()
           
 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 setPartClass(String partClass)
           
 void setPartNamespace(QName partNamespace)
           
 void setPrettyPrint(boolean prettyPrint)
           
 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, 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
Specified by:
marshal in interface org.apache.camel.spi.DataFormat
Throws:
IOException

unmarshal

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

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)

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)

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

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
Throws:
JAXBException


Apache CAMEL