org.apache.camel.converter.jaxb
Class JaxbDataFormat
java.lang.Object
org.apache.camel.support.ServiceSupport
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:
Fields inherited from class org.apache.camel.support.ServiceSupport |
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending |
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 |
JaxbDataFormat
public JaxbDataFormat()
JaxbDataFormat
public JaxbDataFormat(JAXBContext context)
JaxbDataFormat
public JaxbDataFormat(String contextPath)
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