public interface UnionField<CONVERSION_MANAGER extends ConversionManager,NAMESPACE_RESOLVER extends NamespaceResolver> extends Field<CONVERSION_MANAGER,NAMESPACE_RESOLVER>
Subclass of Field for fields that are mapped to unions. Maintains a list of schema types instead of just one single schema type. Schema types can be added using the addSchemaType API. Constants has a list of useful constants including a list of QNames for built-in schema types that can be used when adding schema types.
When reading and writing an element that is mapped with an UnionField, a conversion to each of the schema types on the field (in the order they are specified ) is tried until a conversion is successful. The Java type to convert to is based on the list of schema type to Java conversion pairs specified on the field.
Field
,
Constants
Modifier and Type | Method and Description |
---|---|
void |
addSchemaType(javax.xml.namespace.QName value)
Adds the new type value to the list of types
|
java.util.List<javax.xml.namespace.QName> |
getSchemaTypes()
Return the list of schema types
|
convertValueBasedOnSchemaType, getJavaClass, getLastXPathFragment, getLeafElementType, getName, getNamespaceResolver, getSchemaType, getSchemaTypeForValue, getType, getXMLType, getXPath, getXPathFragment, hasLastXPathFragment, initialize, isCDATA, isRequired, isSchemaType, isSelfField, isTypedTextField, isUnionField, setIsCDATA, setIsTypedTextField, setNamespaceResolver, setRequired, setSchemaType, setUsesSingleNode, setXPath, usesSingleNode
void addSchemaType(javax.xml.namespace.QName value)
value
- QName to be added to the list of schema typesjava.util.List<javax.xml.namespace.QName> getSchemaTypes()
EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference