Top Description Methods
org.eclipse.persistence.internal.oxm.mappings

public Interface UnionField<CONVERSION_MANAGER extends ConversionManager, NAMESPACE_RESOLVER extends NamespaceResolver>

extends Field<CONVERSION_MANAGER extends ConversionManager, NAMESPACE_RESOLVER extends NamespaceResolver>
Known Direct Implementers
org.eclipse.persistence.oxm.XMLUnionField
Imports
java.util.List, javax.xml.namespace.QName, org.eclipse.persistence.internal.oxm.Constants, .ConversionManager, .NamespaceResolver

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.

See Also
Field, Constants

Method Summary

Modifier and TypeMethod and Description
public void
addSchemaType(QName
QName to be added to the list of schema types
value
)

Adds the new type value to the list of types

public List<QName>

Returns:

the list of types
getSchemaTypes
()

Return the list of schema types

Inherited from org.eclipse.persistence.internal.oxm.mappings.Field:
convertValueBasedOnSchemaTypegetJavaClassgetLastXPathFragmentgetLeafElementTypegetNamegetNamespaceResolvergetSchemaTypegetSchemaTypeForValuegetTypegetXMLTypegetXPathgetXPathFragmenthasLastXPathFragmentinitializeisCDATAisNestedArrayisRequiredisSchemaTypeisSelfFieldisTypedTextFieldisUnionFieldsetIsCDATAsetIsTypedTextFieldsetNamespaceResolversetNestedArraysetRequiredsetSchemaTypesetUsesSingleNodesetXPathusesSingleNode

Method Detail

addSchemaTypeback to summary
public void addSchemaType(QName value)

Adds the new type value to the list of types

Parameters
value:QName

QName to be added to the list of schema types

getSchemaTypesback to summary
public List<QName> getSchemaTypes()

Return the list of schema types

Returns:List<QName>

the list of types