Module org.eclipse.persistence.moxy
Package org.eclipse.persistence.jaxb
Class JAXBContextProperties
java.lang.Object
org.eclipse.persistence.jaxb.JAXBContextProperties
These are properties that may be passed in to create a JAXBContext:
 
 Map properties = new HashMap<String, Object>(1);
 properties.put();
 JAXBContext jc = JAXBContext.newInstance(new Class[] {Foo.class}, properties);
 - Since:
- 2.4.0
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic final classSupported values ofeclipselink.moxy.factoryproperty.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringThe name of the property used to specify an AnnotationHelper instance.static final StringEnables or disables generation of XML Facets during schemagen process.static final StringProperty for setting preferred or custom validator factory.static final StringProperty for setting bean validation target groups.static final StringProperty for setting bean validation mode.static final StringProperty for disabling Bean Validation optimisations.static final StringThe name of the property used to specify a default target namespace.static final String` 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 final StringThe name of the property used to specify in the root node should be included in the message (default is true).static final StringThe name of the property used to specify the character (default is '.') that separates the prefix from the key name.static final StringOverride default type property name for JSON as MOXy type discriminator.static final StringIf we should treat unqualified type property in JSON as MOXy type discriminator.static final StringIf there should be xsd prefix when using simple types, e.g.static final StringThe name of the property used to specify the key that will correspond to the property mapped with @XmlValue.static final StringThe Constant JSON_WRAPPER_AS_ARRAY_NAME.static final StringThe name of the property used to specify the type of binding to be performed.static final StringThe name of the property used to specify which JAXB Context Factory will be used for context creation.static final StringProperty for logging Entities content during marshalling/unmarshalling operation in MOXy.static final StringProperty for MOXy logging level.static final StringThe Constant NAMESPACE_PREFIX_MAPPER.static final StringThe 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 final StringThe name of the property used to specify one or more EclipseLink OXM metadata sources.static final StringThe 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 final StringIf set to Boolean.TRUE,JAXBUnmarshallerwill match XML Elements and XML Attributes to Java fields case insensitively.static final StringThe name of the boolean property used to enable custom XmlAccessorFactories.
- 
Constructor SummaryConstructors
- 
Method Summary
- 
Field Details- 
MOXY_FACTORYThe name of the property used to specify which JAXB Context Factory will be used for context creation. DefaultJAXBContextFactorywill be used when this property is not set. Supported values are listed inJAXBContextProperties.Factoryclass.- Since:
- 4.0
- See Also:
 
- 
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. By default there is no attribute prefix. There is no effect when media type is "application/xml". When this property is specified at the JAXBContext level all instances of Marshaller and Unmarshaller will default to this attribute prefix.- Since:
- 2.4
- See Also:
 
- 
JSON_INCLUDE_ROOTThe name of the property used to specify in the root node should be included in the message (default is true). There is no effect when media type is "application/xml". When this property is specified at the JAXBContext level all instances of Marshaller and Unmarshaller will default to this setting.- Since:
- 2.4
- See Also:
 
- 
JSON_NAMESPACE_SEPARATORThe name of the property used to specify the character (default is '.') that separates the prefix from the key name. It is only used if namespace qualification has been enabled be setting a namespace prefix mapper. When this property is specified at the JAXBContext level all instances of Marshaller and Unmarshaller will default to this setting.- Since:
- 2.4
- See Also:
 
- 
JSON_VALUE_WRAPPERThe name of the property used to specify the key that will correspond to the property mapped with @XmlValue. This key will only be used if there are other mapped properties. When this property is specified at the JAXBContext level all instances of Marshaller and Unmarshaller will default to this setting.- Since:
- 2.4
- See Also:
 
- 
MEDIA_TYPEThe name of the property used to specify the type of binding to be performed. When this property is specified at the JAXBContext level all instances of Marshaller and Unmarshaller will default to this media type. Supported values are:- MediaType.APPLICATION_XML (default)
- MediaType.APPLICATION_JSON
- "application/xml"
- "application/json"
 - Since:
- 2.4
- See Also:
 
- 
NAMESPACE_PREFIX_MAPPERThe Constant NAMESPACE_PREFIX_MAPPER. Provides a means to customize the namespace prefixes used while marshalling to XML. Used for both marshal and unmarshal when mediaType is set to "application/json". Value is either a Map of URIs to prefixes, or an implementation of org.eclipse.persistence.oxm.NamespacePrefixMapper.- Since:
- 2.4
- See Also:
 
- 
SESSION_EVENT_LISTENERThe name of the property used to specify a SessionEventListener that can be used to customize the metadata before or after it has been initialized. Value is either an implementation of org.eclipse.persistence.sessions.SessionEventListener or a List<org.eclipse.persistence.sessions.SessionEventListener>.- Since:
- 2.4
- See Also:
 
- 
OXM_METADATA_SOURCEThe name of the property used to specify one or more EclipseLink OXM metadata sources. The metadata source can be one of the following:- java.io.File
- java.io.InputStream
- java.io.Reader
- java.lang.String
- java.net.URL
- javax.xml.stream.XMLEventReader
- javax.xml.stream.XMLStreamReader
- javax.xml.transform.Source
- org.eclipse.persistence.jaxb.metadata.MetadataSource
- org.w3c.dom.Node
- org.xml.sax.InputSource
 - java.util.Map
- java.util.List<Object>
 - Since:
- 2.4, replaces JAXBContextFactory.ECLIPSELINK_OXM_XML_KEY
- See Also:
 
- 
DEFAULT_TARGET_NAMESPACEThe name of the property used to specify a default target namespace.- Since:
- 2.4, replaces JAXBContextFactory.DEFAULT_TARGET_NAMESPACE_KEY
- See Also:
 
- 
ANNOTATION_HELPERThe name of the property used to specify an AnnotationHelper instance. An AnnotationHelper is responsible for returning Annotations from AnnotatedElements.- Since:
- 2.4, replaces JAXBContextFactory.ANNOTATION_HELPER_KEY
- See Also:
 
- 
XML_ACCESSOR_FACTORY_SUPPORTThe name of the boolean property used to enable custom XmlAccessorFactories.- Since:
- 2.4.2
- See Also:
 
- 
OBJECT_GRAPHThe 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.- See Also:
 
- 
JSON_WRAPPER_AS_ARRAY_NAMEThe Constant JSON_WRAPPER_AS_ARRAY_NAME. If true the grouping element will be used as the JSON key. There is no effect when media type is "application/xml". When this property is specified at the JAXBContext level all instances of Marshaller and Unmarshaller will default to this.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" : [ { ... }, { ... }] }- Since:
- 2.4.2
- See Also:
 
- 
JSON_USE_XSD_TYPES_WITH_PREFIXIf there should be xsd prefix when using simple types, e.g. xsd.int.- Since:
- 2.6.0
- See Also:
 
- 
JSON_TYPE_COMPATIBILITYIf we should treat unqualified type property in JSON as MOXy type discriminator.- Since:
- 2.6.0
- See Also:
 
- 
JSON_TYPE_ATTRIBUTE_NAMEOverride default type property name for JSON as MOXy type discriminator. Settings from binding file have higher priority.Example Given the following property conf.put(JAXBContextProperties.JSON_TYPE_ATTRIBUTE_NAME, "mytype"); If the property is set the JSON output will be: ... { "mytype": "phone", "contactId": 3, "number": "987654321" } ...for following object model @XmlSeeAlso({Address.class, Phone.class}) public class Contact { public int contactId; ...public class Phone extends Contact{ public String number; ...If the property is not set (default value) the JSON output will be: ... { "type": "phone", "contactId": 3, "number": "987654321" } ...Unmarshaller will use it as type discriminator to select right child class.- Since:
- 2.7.4
- See Also:
 
- 
UNMARSHALLING_CASE_INSENSITIVEIf set to Boolean.TRUE,JAXBUnmarshallerwill 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 creatingJAXBContext. It will affect only unmarshaller created from that context.Specifying this flag may impose a slight performance penalty. - Since:
- 2.6.0
- See Also:
 
- 
BEAN_VALIDATION_MODEProperty for setting bean validation mode. Allowed valuesBeanValidationMode.AUTO(default),BeanValidationMode.CALLBACK,BeanValidationMode.NONE.- Since:
- 2.6
- See Also:
 
- 
BEAN_VALIDATION_FACTORYProperty for setting preferred or custom validator factory. Mapped value must be of typeValidatorFactory.- Since:
- 2.6
- See Also:
 
- 
BEAN_VALIDATION_GROUPSProperty for setting bean validation target groups. Mapped value must be of type Class[].- Since:
- 2.6
- See Also:
 
- 
BEAN_VALIDATION_FACETSEnables or disables generation of XML Facets during schemagen process. Allowed values areBoolean.TRUEorBoolean.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. Default value isfalse, i.e. facets are not generated by default.- Since:
- 2.6
- See Also:
 
- 
BEAN_VALIDATION_NO_OPTIMISATIONProperty for disabling Bean Validation optimisations. Bean Validation in MOXy features optimisations, which are used to skip BV processes on non-constrained objects. This is to make maintenance easier and to allow for debugging in case that some object is not validated, but should be. Usage: set toBoolean.TRUEto disable optimisations, set toBoolean.FALSEto re-enable them again.- Since:
- 2.6
- See Also:
 
- 
MOXY_LOGGING_LEVELProperty for MOXy logging level. This is to make maintenance easier and to allow MOXy generate more diagnostic log messages. Allowed values are specified inLogLevelDefault value isLogLevel.INFO- Since:
- 3.0
- See Also:
 
- 
MOXY_LOG_PAYLOADProperty for logging Entities content during marshalling/unmarshalling operation in MOXy. It calls toString() method from entity. This is to make maintenance easier and to allow for debugging to check marshalled/unmarshalled content. Use it carefully. It can produce high amount of data in the log files. Usage: set toBoolean.TRUEto enable payload logging, set toBoolean.FALSEto disable it. It can be set via system property with name "eclipselink.logging.payload.moxy" too. By default it is disabled.- Since:
- 3.0
- See Also:
 
 
- 
- 
Constructor Details- 
JAXBContextPropertiespublic JAXBContextProperties()
 
-