Class XStreamDataFormat.Builder
- java.lang.Object
-
- org.apache.camel.model.dataformat.XStreamDataFormat.Builder
-
- All Implemented Interfaces:
DataFormatBuilder<XStreamDataFormat>
- Enclosing class:
- XStreamDataFormat
public static class XStreamDataFormat.Builder extends Object implements DataFormatBuilder<XStreamDataFormat>
Builder
is a specific builder forXStreamDataFormat
.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XStreamDataFormat.Builder
aliases(List<PropertyDefinition> aliases)
Alias a Class to a shorter name to be used in XML elements.XStreamDataFormat.Builder
aliases(Map<String,String> aliases)
XStreamDataFormat.Builder
contentTypeHeader(boolean contentTypeHeader)
XStreamDataFormat.Builder
contentTypeHeader(String contentTypeHeader)
XStreamDataFormat.Builder
converters(List<PropertyDefinition> converters)
List of class names for using custom XStream converters.XStreamDataFormat.Builder
converters(Map<String,String> converters)
XStreamDataFormat.Builder
driver(String driver)
To use a custom XStream driver.XStreamDataFormat.Builder
driverRef(String driverRef)
To refer to a custom XStream driver to lookup in the registry.XStreamDataFormat.Builder
encoding(String encoding)
Sets the encoding to useXStreamDataFormat
end()
Ends the build of the data format.XStreamDataFormat.Builder
implicitCollections(List<PropertyDefinition> implicitCollections)
Adds a default implicit collection which is used for any unmapped XML tag.XStreamDataFormat.Builder
implicitCollections(Map<String,String> implicitCollections)
XStreamDataFormat.Builder
mode(String mode)
Mode for dealing with duplicate references The possible values are: NO_REFERENCES ID_REFERENCES XPATH_RELATIVE_REFERENCES XPATH_ABSOLUTE_REFERENCES SINGLE_NODE_XPATH_RELATIVE_REFERENCES SINGLE_NODE_XPATH_ABSOLUTE_REFERENCESXStreamDataFormat.Builder
omitFields(List<PropertyDefinition> omitFields)
Prevents a field from being serialized.XStreamDataFormat.Builder
omitFields(Map<String,String> aliases)
XStreamDataFormat.Builder
permissions(Class<?>... type)
To add permission for the given pojo classes.XStreamDataFormat.Builder
permissions(String permissions)
Adds permissions that controls which Java packages and classes XStream is allowed to use during unmarshal from xml/json to Java beans.
-
-
-
Method Detail
-
encoding
public XStreamDataFormat.Builder encoding(String encoding)
Sets the encoding to use
-
driver
public XStreamDataFormat.Builder driver(String driver)
To use a custom XStream driver. The instance must be of type com.thoughtworks.xstream.io.HierarchicalStreamDriver
-
driverRef
public XStreamDataFormat.Builder driverRef(String driverRef)
To refer to a custom XStream driver to lookup in the registry. The instance must be of type com.thoughtworks.xstream.io.HierarchicalStreamDriver
-
mode
public XStreamDataFormat.Builder mode(String mode)
Mode for dealing with duplicate references The possible values are:- NO_REFERENCES
- ID_REFERENCES
- XPATH_RELATIVE_REFERENCES
- XPATH_ABSOLUTE_REFERENCES
- SINGLE_NODE_XPATH_RELATIVE_REFERENCES
- SINGLE_NODE_XPATH_ABSOLUTE_REFERENCES
-
converters
public XStreamDataFormat.Builder converters(List<PropertyDefinition> converters)
List of class names for using custom XStream converters. The classes must be of type com.thoughtworks.xstream.converters.Converter
-
converters
public XStreamDataFormat.Builder converters(Map<String,String> converters)
-
aliases
public XStreamDataFormat.Builder aliases(List<PropertyDefinition> aliases)
Alias a Class to a shorter name to be used in XML elements.
-
aliases
public XStreamDataFormat.Builder aliases(Map<String,String> aliases)
-
omitFields
public XStreamDataFormat.Builder omitFields(List<PropertyDefinition> omitFields)
Prevents a field from being serialized. To omit a field you must always provide the declaring type and not necessarily the type that is converted. Multiple values can be separated by comma.
-
omitFields
public XStreamDataFormat.Builder omitFields(Map<String,String> aliases)
-
implicitCollections
public XStreamDataFormat.Builder implicitCollections(List<PropertyDefinition> implicitCollections)
Adds a default implicit collection which is used for any unmapped XML tag. Multiple values can be separated by comma.
-
implicitCollections
public XStreamDataFormat.Builder implicitCollections(Map<String,String> implicitCollections)
-
permissions
public XStreamDataFormat.Builder permissions(String permissions)
Adds permissions that controls which Java packages and classes XStream is allowed to use during unmarshal from xml/json to Java beans. A permission must be configured either here or globally using a JVM system property. The permission can be specified in a syntax where a plus sign is allow, and minus sign is deny.
Wildcards is supported by using .* as prefix. For example to allow com.foo and all subpackages then specify +com.foo.*. Multiple permissions can be configured separated by comma, such as +com.foo.*,-com.foo.bar.MySecretBean.
The following default permission is always included: "-*,java.lang.*,java.util.*" unless its overridden by specifying a JVM system property with they key org.apache.camel.xstream.permissions.
-
permissions
public XStreamDataFormat.Builder permissions(Class<?>... type)
To add permission for the given pojo classes.- Parameters:
type
- the pojo class(es) xstream should use as allowed permission- See Also:
XStreamDataFormat.setPermissions(String)
-
contentTypeHeader
public XStreamDataFormat.Builder contentTypeHeader(String contentTypeHeader)
-
contentTypeHeader
public XStreamDataFormat.Builder contentTypeHeader(boolean contentTypeHeader)
-
end
public XStreamDataFormat end()
Description copied from interface:DataFormatBuilder
Ends the build of the data format.- Specified by:
end
in interfaceDataFormatBuilder<XStreamDataFormat>
- Returns:
- the data format fully built.
-
-