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 for JaxbDataFormat
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaccessExternalSchemaProtocols
(String accessExternalSchemaProtocols) Only in use if schema validation has been enabled.contentTypeHeader
(boolean contentTypeHeader) contentTypeHeader
(String contentTypeHeader) contextPath
(String contextPath) Package name where your JAXB classes are located.contextPathIsClassName
(boolean contextPathIsClassName) This can be set to true to mark that the contextPath is referring to a classname and not a package name.contextPathIsClassName
(String contextPathIsClassName) This can be set to true to mark that the contextPath is referring to a classname and not a package name.To overrule and use a specific encodingend()
Ends the build of the data format.filterNonXmlChars
(boolean filterNonXmlChars) To ignore non xml characters and replace them with an empty space.filterNonXmlChars
(String filterNonXmlChars) To ignore non xml characters and replace them with an empty space.fragment
(boolean fragment) To turn on marshalling XML fragment trees.To turn on marshalling XML fragment trees.ignoreJAXBElement
(boolean ignoreJAXBElement) Whether to ignore JAXBElement elements - only needed to be set to false in very special use-cases.ignoreJAXBElement
(String ignoreJAXBElement) Whether to ignore JAXBElement elements - only needed to be set to false in very special use-cases.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.mustBeJAXBElement
(boolean mustBeJAXBElement) Whether marhsalling must be java objects with JAXB annotations.mustBeJAXBElement
(String mustBeJAXBElement) Whether marhsalling must be java objects with JAXB annotations.namespacePrefixRef
(String namespacePrefixRef) When marshalling using JAXB or SOAP then the JAXB implementation will automatically assign namespace prefixes, such as ns2, ns3, ns4 etc.noNamespaceSchemaLocation
(String schemaLocation) To define the location of the namespaceless schemaobjectFactory
(boolean objectFactory) Whether to allow using ObjectFactory classes to create the POJO classes during marshalling.objectFactory
(String objectFactory) Whether to allow using ObjectFactory classes to create the POJO classes during marshalling.Name of class used for fragment parsing.partNamespace
(String partNamespace) XML namespace to use for fragment parsing.prettyPrint
(boolean prettyPrint) To enable pretty printing output nicely formatted.prettyPrint
(String prettyPrint) To enable pretty printing output nicely formatted.To validate against an existing schema.schemaLocation
(String schemaLocation) To define the location of the schemaschemaSeverityLevel
(int schemaSeverityLevel) Sets the schema severity level to use when validating against a schema.schemaSeverityLevel
(String schemaSeverityLevel) Sets the schema severity level to use when validating against a schema.xmlStreamWriterWrapper
(String xmlStreamWriterWrapperRef) To use a custom xml stream writer.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
contextPath
Package name where your JAXB classes are located. -
contextPathIsClassName
This can be set to true to mark that the contextPath is referring to a classname and not a package name. -
contextPathIsClassName
This can be set to true to mark that the contextPath is referring to a classname and not a package name. -
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
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
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
To enable pretty printing output nicely formatted. Is by default false. -
prettyPrint
To enable pretty printing output nicely formatted. Is by default false. -
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
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
Whether to ignore JAXBElement elements - only needed to be set to false in very special use-cases. -
ignoreJAXBElement
Whether to ignore JAXBElement elements - only needed to be set to false in very special use-cases. -
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
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
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
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
To ignore non xml characters and replace them with an empty space. -
filterNonXmlChars
To ignore non xml characters and replace them with an empty space. -
encoding
To overrule and use a specific encoding -
partClass
Name of class used for fragment parsing. See more details at the fragment option. -
partNamespace
XML namespace to use for fragment parsing. See more details at the fragment option. -
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
To use a custom xml stream writer. -
schemaLocation
To define the location of the schema -
noNamespaceSchemaLocation
To define the location of the namespaceless schema -
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
-
contentTypeHeader
-
accessExternalSchemaProtocols
Only in use if schema validation has been enabled. Restrict access to the protocols specified for external reference set by the schemaLocation attribute, Import and Include element. Examples of protocols are file, http, jar:file. false or none to deny all access to external references; a specific protocol, such as file, to give permission to only the protocol; the keyword all to grant permission to all protocols. -
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.
-