public class JAXBContextProperties
extends java.lang.Object
Map properties = new HashMap<String, Object>(1); properties.put(); JAXBContext jc = JAXBContext.newInstance(new Class[] {Foo.class}, properties);
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ANNOTATION_HELPER
The name of the property used to specify an AnnotationHelper instance.
|
static java.lang.String |
BEAN_VALIDATION_FACETS
Property for disabling/enabling generation of XML Facets during schemagen.
|
static java.lang.String |
BEAN_VALIDATION_FACTORY
Property for setting preferred or custom validator factory.
|
static java.lang.String |
BEAN_VALIDATION_GROUPS
Property for setting bean validation target groups.
|
static java.lang.String |
BEAN_VALIDATION_MODE
Property for setting bean validation mode.
|
static java.lang.String |
BEAN_VALIDATION_NO_OPTIMISATION
Property for disabling Bean Validation optimisations.
|
static java.lang.String |
DEFAULT_TARGET_NAMESPACE
The name of the property used to specify a default target namespace.
|
static java.lang.String |
JSON_ATTRIBUTE_PREFIX
`
The name of the property used to specify a value that will be prepended
to all keys that are mapped to an XML attribute.
|
static java.lang.String |
JSON_INCLUDE_ROOT
The name of the property used to specify in the root node should be
included in the message (default is true).
|
static java.lang.String |
JSON_NAMESPACE_SEPARATOR
The name of the property used to specify the character (default is '.')
|
static java.lang.String |
JSON_TYPE_COMPATIBILITY
If we should treat unqualified type property in JSON as MOXy type discriminator.
|
static java.lang.String |
JSON_USE_XSD_TYPES_WITH_PREFIX
If there should be xsd prefix when using simple types, e.g. xsd.int.
|
static java.lang.String |
JSON_VALUE_WRAPPER
The name of the property used to specify the key that will correspond to
the property mapped with @XmlValue.
|
static java.lang.String |
JSON_WRAPPER_AS_ARRAY_NAME
The Constant JSON_WRAPPER_AS_ARRAY_NAME.
|
static java.lang.String |
MEDIA_TYPE
The name of the property used to specify the type of binding to be
performed.
|
static java.lang.String |
NAMESPACE_PREFIX_MAPPER
The Constant NAMESPACE_PREFIX_MAPPER.
|
static java.lang.String |
OBJECT_GRAPH
The name of the property used to specify an ObjectGraph instance or name of an
ObjectGraph to be used on Unmarshallers and Marshallers created by the context.
|
static java.lang.String |
OXM_METADATA_SOURCE
The name of the property used to specify one or more EclipseLink OXM
metadata sources.
|
static java.lang.String |
SESSION_EVENT_LISTENER
The name of the property used to specify a SessionEventListener that can
be used to customize the metadata before or after it has been
initialized.
|
static java.lang.String |
UNMARSHALLING_CASE_INSENSITIVE
If set to Boolean.TRUE,
JAXBUnmarshaller will match
XML Elements and XML Attributes to Java fields case insensitively. |
static java.lang.String |
XML_ACCESSOR_FACTORY_SUPPORT
The name of the boolean property used to enable custom XmlAccessorFactories.
|
Constructor and Description |
---|
JAXBContextProperties() |
public static final java.lang.String JSON_ATTRIBUTE_PREFIX
public static final java.lang.String JSON_INCLUDE_ROOT
JSON_INCLUDE_ROOT
,
UnmarshallerProperties.JSON_INCLUDE_ROOT
,
Constant Field Valuespublic static final java.lang.String JSON_NAMESPACE_SEPARATOR
public static final java.lang.String JSON_VALUE_WRAPPER
public static final java.lang.String MEDIA_TYPE
MarshallerProperties.MEDIA_TYPE
,
UnmarshallerProperties.MEDIA_TYPE
,
MediaType
,
Constant Field Valuespublic static final java.lang.String NAMESPACE_PREFIX_MAPPER
NamespacePrefixMapper
,
Constant Field Valuespublic static final java.lang.String SESSION_EVENT_LISTENER
SessionEventListener
,
Constant Field Valuespublic static final java.lang.String OXM_METADATA_SOURCE
public static final java.lang.String DEFAULT_TARGET_NAMESPACE
public static final java.lang.String ANNOTATION_HELPER
AnnotationHelper
,
Annotation
,
AnnotatedElement
,
Constant Field Valuespublic static final java.lang.String XML_ACCESSOR_FACTORY_SUPPORT
XmlAccessorFactory
,
Constant Field Valuespublic static final java.lang.String OBJECT_GRAPH
public static final java.lang.String JSON_WRAPPER_AS_ARRAY_NAME
Example
Given the following class:
@XmlAccessorType(XmlAccessType.FIELD) public class Customer { @XmlElementWrapper(name="phone-numbers") @XmlElement(name="phone-number") private List<PhoneNumber> phoneNumbers; }
If the property is set to false (the default) the JSON output will be:
{ "phone-numbers" : { "phone-number" : [ { ... }, { ... }] } }
And if the property is set to true, then the JSON output will be:
{ "phone-numbers" : [ { ... }, { ... }] }
public static final java.lang.String JSON_USE_XSD_TYPES_WITH_PREFIX
public static final java.lang.String JSON_TYPE_COMPATIBILITY
public static final java.lang.String UNMARSHALLING_CASE_INSENSITIVE
JAXBUnmarshaller
will match
XML Elements and XML Attributes to Java fields case insensitively.
Example
Given the following class:
@XmlAccessorType(XmlAccessType.FIELD) public class Customer { @XmlElement private String name; @XmlAttribute private int id; }
If the property is set to true, the following XML object will match the class and will be unmarshaled.
<customer iD="007"> <nAMe>cafeBabe</nAMe> </customer>
By default, case-insensitive unmarshalling is turned off.
The property must be passed to the JAXBContextFactory
, when creating
JAXBContext
. It will affect only unmarshaller created from that context.
Specifying this flag may impose a slight performance penalty.
UnmarshallerProperties.UNMARSHALLING_CASE_INSENSITIVE
,
Constant Field Valuespublic static final java.lang.String BEAN_VALIDATION_MODE
BeanValidationMode.AUTO
(default),BeanValidationMode.CALLBACK
, BeanValidationMode.NONE
.public static final java.lang.String BEAN_VALIDATION_FACTORY
ValidatorFactory
.public static final java.lang.String BEAN_VALIDATION_GROUPS
public static final java.lang.String BEAN_VALIDATION_FACETS
Boolean.TRUE
or Boolean.FALSE
,
effectively stating that facets (based on the BV annotations) will be generated,
or that the BV annotations processing will be skipped during schemagen
with no facets being generated, respectively.public static final java.lang.String BEAN_VALIDATION_NO_OPTIMISATION
Boolean.TRUE
to disable optimisations, set to Boolean.FALSE
to re-enable them
again.