Class JaxbDataFormat.Builder
- java.lang.Object
-
- org.apache.camel.model.dataformat.JaxbDataFormat.Builder
-
- All Implemented Interfaces:
DataFormatBuilder<JaxbDataFormat>
- Enclosing class:
- JaxbDataFormat
public static class JaxbDataFormat.Builder extends Object implements DataFormatBuilder<JaxbDataFormat>
Builder
is a specific builder forJaxbDataFormat
.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JaxbDataFormat.Builder
contentTypeHeader(boolean contentTypeHeader)
JaxbDataFormat.Builder
contentTypeHeader(String contentTypeHeader)
JaxbDataFormat.Builder
contextPath(String contextPath)
Package name where your JAXB classes are located.JaxbDataFormat.Builder
contextPathIsClassName(boolean contextPathIsClassName)
This can be set to true to mark that the contextPath is referring to a classname and not a package name.JaxbDataFormat.Builder
contextPathIsClassName(String contextPathIsClassName)
This can be set to true to mark that the contextPath is referring to a classname and not a package name.JaxbDataFormat.Builder
encoding(String encoding)
To overrule and use a specific encodingJaxbDataFormat
end()
Ends the build of the data format.JaxbDataFormat.Builder
filterNonXmlChars(boolean filterNonXmlChars)
To ignore non xml characters and replace them with an empty space.JaxbDataFormat.Builder
filterNonXmlChars(String filterNonXmlChars)
To ignore non xml characters and replace them with an empty space.JaxbDataFormat.Builder
fragment(boolean fragment)
To turn on marshalling XML fragment trees.JaxbDataFormat.Builder
fragment(String fragment)
To turn on marshalling XML fragment trees.JaxbDataFormat.Builder
ignoreJAXBElement(boolean ignoreJAXBElement)
Whether to ignore JAXBElement elements - only needed to be set to false in very special use-cases.JaxbDataFormat.Builder
ignoreJAXBElement(String ignoreJAXBElement)
Whether to ignore JAXBElement elements - only needed to be set to false in very special use-cases.JaxbDataFormat.Builder
jaxbProviderProperties(String jaxbProviderProperties)
Refers to a custom java.util.Map to lookup in the registry containing custom JAXB provider properties to be used with the JAXB marshaller.JaxbDataFormat.Builder
mustBeJAXBElement(boolean mustBeJAXBElement)
Whether marhsalling must be java objects with JAXB annotations.JaxbDataFormat.Builder
mustBeJAXBElement(String mustBeJAXBElement)
Whether marhsalling must be java objects with JAXB annotations.JaxbDataFormat.Builder
namespacePrefixRef(String namespacePrefixRef)
When marshalling using JAXB or SOAP then the JAXB implementation will automatically assign namespace prefixes, such as ns2, ns3, ns4 etc.JaxbDataFormat.Builder
noNamespaceSchemaLocation(String schemaLocation)
To define the location of the namespaceless schemaJaxbDataFormat.Builder
objectFactory(boolean objectFactory)
Whether to allow using ObjectFactory classes to create the POJO classes during marshalling.JaxbDataFormat.Builder
objectFactory(String objectFactory)
Whether to allow using ObjectFactory classes to create the POJO classes during marshalling.JaxbDataFormat.Builder
partClass(String partClass)
Name of class used for fragment parsing.JaxbDataFormat.Builder
partNamespace(String partNamespace)
XML namespace to use for fragment parsing.JaxbDataFormat.Builder
prettyPrint(boolean prettyPrint)
To enable pretty printing output nicely formatted.JaxbDataFormat.Builder
prettyPrint(String prettyPrint)
To enable pretty printing output nicely formatted.JaxbDataFormat.Builder
schema(String schema)
To validate against an existing schema.JaxbDataFormat.Builder
schemaLocation(String schemaLocation)
To define the location of the schemaJaxbDataFormat.Builder
schemaSeverityLevel(int schemaSeverityLevel)
Sets the schema severity level to use when validating against a schema.JaxbDataFormat.Builder
schemaSeverityLevel(String schemaSeverityLevel)
Sets the schema severity level to use when validating against a schema.JaxbDataFormat.Builder
xmlStreamWriterWrapper(String xmlStreamWriterWrapperRef)
To use a custom xml stream writer.
-
-
-
Method Detail
-
contextPath
public JaxbDataFormat.Builder contextPath(String contextPath)
Package name where your JAXB classes are located.
-
contextPathIsClassName
public JaxbDataFormat.Builder contextPathIsClassName(String contextPathIsClassName)
This can be set to true to mark that the contextPath is referring to a classname and not a package name.
-
contextPathIsClassName
public JaxbDataFormat.Builder contextPathIsClassName(boolean contextPathIsClassName)
This can be set to true to mark that the contextPath is referring to a classname and not a package name.
-
schema
public JaxbDataFormat.Builder schema(String schema)
To validate against an existing schema. Your can use the prefix classpath:, file:* or *http: to specify how the resource should be resolved. You can separate multiple schema files by using the ',' character.
-
schemaSeverityLevel
public JaxbDataFormat.Builder schemaSeverityLevel(String schemaSeverityLevel)
Sets the schema severity level to use when validating against a schema. This level determines the minimum severity error that triggers JAXB to stop continue parsing. The default value of 0 (warning) means that any error (warning, error or fatal error) will trigger JAXB to stop. There are the following three levels: 0=warning, 1=error, 2=fatal error.
-
schemaSeverityLevel
public JaxbDataFormat.Builder schemaSeverityLevel(int schemaSeverityLevel)
Sets the schema severity level to use when validating against a schema. This level determines the minimum severity error that triggers JAXB to stop continue parsing. The default value of 0 (warning) means that any error (warning, error or fatal error) will trigger JAXB to stop. There are the following three levels: 0=warning, 1=error, 2=fatal error.
-
prettyPrint
public JaxbDataFormat.Builder prettyPrint(String prettyPrint)
To enable pretty printing output nicely formatted. Is by default false.
-
prettyPrint
public JaxbDataFormat.Builder prettyPrint(boolean prettyPrint)
To enable pretty printing output nicely formatted. Is by default false.
-
objectFactory
public JaxbDataFormat.Builder objectFactory(String objectFactory)
Whether to allow using ObjectFactory classes to create the POJO classes during marshalling. This only applies to POJO classes that has not been annotated with JAXB and providing jaxb.index descriptor files.
-
objectFactory
public JaxbDataFormat.Builder objectFactory(boolean objectFactory)
Whether to allow using ObjectFactory classes to create the POJO classes during marshalling. This only applies to POJO classes that has not been annotated with JAXB and providing jaxb.index descriptor files.
-
ignoreJAXBElement
public JaxbDataFormat.Builder ignoreJAXBElement(String ignoreJAXBElement)
Whether to ignore JAXBElement elements - only needed to be set to false in very special use-cases.
-
ignoreJAXBElement
public JaxbDataFormat.Builder ignoreJAXBElement(boolean ignoreJAXBElement)
Whether to ignore JAXBElement elements - only needed to be set to false in very special use-cases.
-
mustBeJAXBElement
public JaxbDataFormat.Builder mustBeJAXBElement(String mustBeJAXBElement)
Whether marhsalling must be java objects with JAXB annotations. And if not then it fails. This option can be set to false to relax that, such as when the data is already in XML format.
-
mustBeJAXBElement
public JaxbDataFormat.Builder mustBeJAXBElement(boolean mustBeJAXBElement)
Whether marhsalling must be java objects with JAXB annotations. And if not then it fails. This option can be set to false to relax that, such as when the data is already in XML format.
-
fragment
public JaxbDataFormat.Builder fragment(String fragment)
To turn on marshalling XML fragment trees. By default JAXB looks for @XmlRootElement annotation on given class to operate on whole XML tree. This is useful but not always - sometimes generated code does not have @XmlRootElement annotation, sometimes you need unmarshall only part of tree. In that case you can use partial unmarshalling. To enable this behaviours you need set property partClass. Camel will pass this class to JAXB's unmarshaler.
-
fragment
public JaxbDataFormat.Builder fragment(boolean fragment)
To turn on marshalling XML fragment trees. By default JAXB looks for @XmlRootElement annotation on given class to operate on whole XML tree. This is useful but not always - sometimes generated code does not have @XmlRootElement annotation, sometimes you need unmarshall only part of tree. In that case you can use partial unmarshalling. To enable this behaviours you need set property partClass. Camel will pass this class to JAXB's unmarshaler.
-
filterNonXmlChars
public JaxbDataFormat.Builder filterNonXmlChars(String filterNonXmlChars)
To ignore non xml characters and replace them with an empty space.
-
filterNonXmlChars
public JaxbDataFormat.Builder filterNonXmlChars(boolean filterNonXmlChars)
To ignore non xml characters and replace them with an empty space.
-
encoding
public JaxbDataFormat.Builder encoding(String encoding)
To overrule and use a specific encoding
-
partClass
public JaxbDataFormat.Builder partClass(String partClass)
Name of class used for fragment parsing. See more details at the fragment option.
-
partNamespace
public JaxbDataFormat.Builder partNamespace(String partNamespace)
XML namespace to use for fragment parsing. See more details at the fragment option.
-
namespacePrefixRef
public JaxbDataFormat.Builder namespacePrefixRef(String namespacePrefixRef)
When marshalling using JAXB or SOAP then the JAXB implementation will automatically assign namespace prefixes, such as ns2, ns3, ns4 etc. To control this mapping, Camel allows you to refer to a map which contains the desired mapping.
-
xmlStreamWriterWrapper
public JaxbDataFormat.Builder xmlStreamWriterWrapper(String xmlStreamWriterWrapperRef)
To use a custom xml stream writer.
-
schemaLocation
public JaxbDataFormat.Builder schemaLocation(String schemaLocation)
To define the location of the schema
-
noNamespaceSchemaLocation
public JaxbDataFormat.Builder noNamespaceSchemaLocation(String schemaLocation)
To define the location of the namespaceless schema
-
jaxbProviderProperties
public JaxbDataFormat.Builder jaxbProviderProperties(String jaxbProviderProperties)
Refers to a custom java.util.Map to lookup in the registry containing custom JAXB provider properties to be used with the JAXB marshaller.
-
contentTypeHeader
public JaxbDataFormat.Builder contentTypeHeader(String contentTypeHeader)
-
contentTypeHeader
public JaxbDataFormat.Builder contentTypeHeader(boolean contentTypeHeader)
-
end
public JaxbDataFormat end()
Description copied from interface:DataFormatBuilder
Ends the build of the data format.- Specified by:
end
in interfaceDataFormatBuilder<JaxbDataFormat>
- Returns:
- the data format fully built.
-
-