Package org.apache.camel.converter.jaxb
Class JaxbDataFormat
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.converter.jaxb.JaxbDataFormat
-
- All Implemented Interfaces:
AutoCloseable
,org.apache.camel.CamelContextAware
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.spi.DataFormat
,org.apache.camel.spi.DataFormatContentTypeHeader
,org.apache.camel.spi.DataFormatName
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
@Dataformat("jaxb") public class JaxbDataFormat extends org.apache.camel.support.service.ServiceSupport implements org.apache.camel.spi.DataFormat, org.apache.camel.spi.DataFormatName, org.apache.camel.spi.DataFormatContentTypeHeader, org.apache.camel.CamelContextAware
A data format (DataFormat
) using JAXB2 to marshal to and from XML
-
-
Constructor Summary
Constructors Constructor Description JaxbDataFormat()
JaxbDataFormat(String contextPath)
JaxbDataFormat(JAXBContext context)
-
Method Summary
-
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, 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
-
getDataFormatName
public String getDataFormatName()
- Specified by:
getDataFormatName
in interfaceorg.apache.camel.spi.DataFormatName
-
marshal
public void marshal(org.apache.camel.Exchange exchange, Object graph, OutputStream stream) throws IOException
- Specified by:
marshal
in interfaceorg.apache.camel.spi.DataFormat
- Throws:
IOException
-
unmarshal
public Object unmarshal(org.apache.camel.Exchange exchange, InputStream stream) throws IOException
- Specified by:
unmarshal
in interfaceorg.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)
-
isMustBeJAXBElement
public boolean isMustBeJAXBElement()
-
setMustBeJAXBElement
public void setMustBeJAXBElement(boolean mustBeJAXBElement)
-
getContext
public JAXBContext getContext()
-
setContext
public void setContext(JAXBContext context)
-
getContextPath
public String getContextPath()
-
setContextPath
public void setContextPath(String contextPath)
-
isContextPathIsClassName
public boolean isContextPathIsClassName()
-
setContextPathIsClassName
public void setContextPathIsClassName(boolean contextPathIsClassName)
-
getSchemaFactory
public SchemaFactory getSchemaFactory() throws SAXException
- Throws:
SAXException
-
setSchemaFactory
public void setSchemaFactory(SchemaFactory schemaFactory)
-
getSchema
public String getSchema()
-
setSchema
public void setSchema(String schema)
-
getSchemaSeverityLevel
public int getSchemaSeverityLevel()
-
setSchemaSeverityLevel
public void setSchemaSeverityLevel(int schemaSeverityLevel)
-
isPrettyPrint
public boolean isPrettyPrint()
-
setPrettyPrint
public void setPrettyPrint(boolean prettyPrint)
-
isObjectFactory
public boolean isObjectFactory()
-
setObjectFactory
public void setObjectFactory(boolean objectFactory)
-
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 Class<?> getPartClass()
-
setPartClass
public void setPartClass(Class<?> partClass)
-
getCamelContext
public org.apache.camel.CamelContext getCamelContext()
- Specified by:
getCamelContext
in interfaceorg.apache.camel.CamelContextAware
-
setCamelContext
public void setCamelContext(org.apache.camel.CamelContext camelContext)
- Specified by:
setCamelContext
in interfaceorg.apache.camel.CamelContextAware
-
getXmlStreamWriterWrapper
public JaxbXmlStreamWriterWrapper getXmlStreamWriterWrapper()
-
setXmlStreamWriterWrapper
public void setXmlStreamWriterWrapper(JaxbXmlStreamWriterWrapper xmlStreamWriterWrapper)
-
getSchemaLocation
public String getSchemaLocation()
-
setSchemaLocation
public void setSchemaLocation(String schemaLocation)
-
getNoNamespaceSchemaLocation
public String getNoNamespaceSchemaLocation()
-
setNoNamespaceSchemaLocation
public void setNoNamespaceSchemaLocation(String schemaLocation)
-
setJaxbProviderProperties
public void setJaxbProviderProperties(Map<String,Object> jaxbProviderProperties)
-
isContentTypeHeader
public boolean isContentTypeHeader()
-
setContentTypeHeader
public void setContentTypeHeader(boolean contentTypeHeader)
If enabled then JAXB will set the Content-Type header to application/xml when marshalling.- Specified by:
setContentTypeHeader
in interfaceorg.apache.camel.spi.DataFormatContentTypeHeader
-
getAccessExternalSchemaProtocols
public String getAccessExternalSchemaProtocols()
-
setAccessExternalSchemaProtocols
public void setAccessExternalSchemaProtocols(String accessExternalSchemaProtocols)
-
doStart
protected void doStart() throws Exception
- Overrides:
doStart
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
doStop
protected void doStop() throws Exception
- Overrides:
doStop
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
createContext
protected JAXBContext createContext() throws Exception
Strategy to create JAXB context- Throws:
Exception
-
createUnmarshaller
protected Unmarshaller createUnmarshaller() throws JAXBException
- Throws:
JAXBException
-
createMarshaller
protected Marshaller createMarshaller() throws JAXBException
- Throws:
JAXBException
-
-