Interface Descriptor<ATTRIBUTE_ACCESSOR extends CoreAttributeAccessor,CORE_MAPPING extends CoreMapping,FIELD extends CoreField,INHERITANCE_POLICY extends CoreInheritancePolicy,INSTANTIATION_POLICY extends CoreInstantiationPolicy,NAMESPACE_RESOLVER extends NamespaceResolver,OBJECT_BUILDER extends CoreObjectBuilder,TABLE extends CoreTable,UNMARSHAL_RECORD extends UnmarshalRecord,UNMARSHALLER extends Unmarshaller>
-
- All Known Implementing Classes:
XMLDescriptor,XMLSequencedDescriptor
public interface Descriptor<ATTRIBUTE_ACCESSOR extends CoreAttributeAccessor,CORE_MAPPING extends CoreMapping,FIELD extends CoreField,INHERITANCE_POLICY extends CoreInheritancePolicy,INSTANTIATION_POLICY extends CoreInstantiationPolicy,NAMESPACE_RESOLVER extends NamespaceResolver,OBJECT_BUILDER extends CoreObjectBuilder,TABLE extends CoreTable,UNMARSHAL_RECORD extends UnmarshalRecord,UNMARSHALLER extends Unmarshaller>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CORE_MAPPINGaddMapping(CORE_MAPPING mapping)Add a database mapping to the receiver.voidaddPrimaryKeyField(FIELD field)ADVANCED: Specify the primary key field of the descriptors table.voidaddRootElement(java.lang.String rootElementName)Add a root element name for the Descriptor This value is stored in place of a table namejava.lang.StringgetAlias()Get the aliasCoreAttributeGroupgetAttributeGroup(java.lang.String subgraph)java.lang.StringgetDefaultRootElement()Return the default root element name for the ClassDescriptor This value is stored in place of a table name This value is mandatory for all root objectsFieldgetDefaultRootElementField()javax.xml.namespace.QNamegetDefaultRootElementType()INHERITANCE_POLICYgetInheritancePolicy()The inheritance policy is used to define how a descriptor takes part in inheritance.INHERITANCE_POLICYgetInheritancePolicyOrNull()INTERNAL: Return the inheritance policy.INSTANTIATION_POLICYgetInstantiationPolicy()INTERNAL: Returns the instantiation policy.java.lang.ClassgetJavaClass()Return the java class.java.lang.StringgetJavaClassName()Return the class name, used by the MW.ATTRIBUTE_ACCESSORgetLocationAccessor()INTERNAL: Returns this Descriptor's location accessor, if one is defined.CORE_MAPPINGgetMappingForAttributeName(java.lang.String attributeName)Returns the mapping associated with a given attribute name.java.util.Vector<CORE_MAPPING>getMappings()Returns mappingsNAMESPACE_RESOLVERgetNamespaceResolver()Return the NamespaceResolver associated with this descriptorNAMESPACE_RESOLVERgetNonNullNamespaceResolver()OBJECT_BUILDERgetObjectBuilder()INTERNAL: Return the object builderjava.util.Vector<java.lang.String>getPrimaryKeyFieldNames()Return the names of all the primary keys.java.util.List<FIELD>getPrimaryKeyFields()INTERNAL: Return all the primary key fieldsXMLSchemaReferencegetSchemaReference()Return the SchemaReference associated with this descriptorjava.util.VectorgetTableNames()Return the table names.java.util.Vector<TABLE>getTables()INTERNAL: Return all the tables.FIELDgetTypedField(FIELD field)INTERNAL: searches first descriptor than its ReturningPolicy for an equal fieldbooleanhasInheritance()INTERNAL: Return if this descriptor is involved in inheritance, (is child or parent).booleanisLazilyInitialized()If true, the descriptor may be lazily initialized.booleanisResultAlwaysXMLRoot()booleanisSequencedObject()INTERNAL:booleanisWrapper()voidsetDefaultRootElement(java.lang.String newDefaultRootElement)Return the default root element name for the ClassDescriptor This value is stored in place of a table name This value is mandatory for all root objectsvoidsetInstantiationPolicy(INSTANTIATION_POLICY instantiationPolicy)INTERNAL: Sets the instantiation policy.voidsetJavaClass(java.lang.Class theJavaClass)Set the Java class that this descriptor maps.voidsetJavaClassName(java.lang.String theJavaClassName)INTERNAL: Return the java class name, used by the MW.voidsetLocationAccessor(ATTRIBUTE_ACCESSOR attributeAccessor)INTERNAL: Set this Descriptor's location accessor.voidsetNamespaceResolver(NAMESPACE_RESOLVER newNamespaceResolver)Set the NamespaceResolver to associate with this descriptorvoidsetProperties(java.util.Map properties)INTERNAL: Set the user defined properties.voidsetResultAlwaysXMLRoot(boolean resultAlwaysXMLRoot)voidsetSchemaReference(XMLSchemaReference newSchemaReference)Set the SchemaReference to associate with this descriptorbooleanshouldPreserveDocument()Return if unmapped information from the XML document should be maintained for this descriptor By default unmapped data is not preserved.java.lang.ObjectwrapObjectInXMLRoot(java.lang.Object object, java.lang.String elementNamespaceUri, java.lang.String elementLocalName, java.lang.String elementPrefix, boolean forceWrap, boolean isNamespaceAware, UNMARSHALLER xmlUnmarshaller)INTERNAL: Determines the appropriate object to return from the unmarshal call.java.lang.ObjectwrapObjectInXMLRoot(java.lang.Object object, java.lang.String elementNamespaceUri, java.lang.String elementLocalName, java.lang.String elementPrefix, java.lang.String encoding, java.lang.String version, boolean forceWrap, boolean isNamespaceAware, UNMARSHALLER unmarshaller)INTERNAL:java.lang.ObjectwrapObjectInXMLRoot(UNMARSHAL_RECORD unmarshalRecord, boolean forceWrap)INTERNAL: Determines the appropriate object to return from the unmarshal call.
-
-
-
Method Detail
-
addMapping
CORE_MAPPING addMapping(CORE_MAPPING mapping)
Add a database mapping to the receiver. Perform any required initialization of both the mapping and the receiving descriptor as a result of adding the new mapping.
-
addPrimaryKeyField
void addPrimaryKeyField(FIELD field)
ADVANCED: Specify the primary key field of the descriptors table. This should be called for each field that makes up the primary key of the table. This can be used for advanced field types, such as XML nodes, or to set the field type.
-
addRootElement
void addRootElement(java.lang.String rootElementName)
Add a root element name for the Descriptor This value is stored in place of a table name- Parameters:
rootElementName- a root element to specify on this Descriptor
-
getAlias
java.lang.String getAlias()
Get the alias
-
getDefaultRootElement
java.lang.String getDefaultRootElement()
Return the default root element name for the ClassDescriptor This value is stored in place of a table name This value is mandatory for all root objects- Returns:
- the default root element specified on this ClassDescriptor
-
getDefaultRootElementType
javax.xml.namespace.QName getDefaultRootElementType()
-
getDefaultRootElementField
Field getDefaultRootElementField()
-
getInheritancePolicy
INHERITANCE_POLICY getInheritancePolicy()
The inheritance policy is used to define how a descriptor takes part in inheritance. All inheritance properties for both child and parent classes is configured in inheritance policy. Caution must be used in using this method as it lazy initializes an inheritance policy. Calling this on a descriptor that does not use inheritance will cause problems, #hasInheritance() must always first be called.
-
getInheritancePolicyOrNull
INHERITANCE_POLICY getInheritancePolicyOrNull()
INTERNAL: Return the inheritance policy.
-
getInstantiationPolicy
INSTANTIATION_POLICY getInstantiationPolicy()
INTERNAL: Returns the instantiation policy.
-
getJavaClass
java.lang.Class getJavaClass()
Return the java class.
-
getJavaClassName
java.lang.String getJavaClassName()
Return the class name, used by the MW.
-
getLocationAccessor
ATTRIBUTE_ACCESSOR getLocationAccessor()
INTERNAL: Returns this Descriptor's location accessor, if one is defined.
-
getMappingForAttributeName
CORE_MAPPING getMappingForAttributeName(java.lang.String attributeName)
Returns the mapping associated with a given attribute name. This can be used to find a descriptors mapping in a amendment method before the descriptor has been initialized.
-
getMappings
java.util.Vector<CORE_MAPPING> getMappings()
Returns mappings
-
getNamespaceResolver
NAMESPACE_RESOLVER getNamespaceResolver()
Return the NamespaceResolver associated with this descriptor- Returns:
- the NamespaceResolver associated with this descriptor
-
getNonNullNamespaceResolver
NAMESPACE_RESOLVER getNonNullNamespaceResolver()
-
getObjectBuilder
OBJECT_BUILDER getObjectBuilder()
INTERNAL: Return the object builder
-
getPrimaryKeyFieldNames
java.util.Vector<java.lang.String> getPrimaryKeyFieldNames()
Return the names of all the primary keys.
-
getPrimaryKeyFields
java.util.List<FIELD> getPrimaryKeyFields()
INTERNAL: Return all the primary key fields
-
getSchemaReference
XMLSchemaReference getSchemaReference()
Return the SchemaReference associated with this descriptor- Returns:
- the SchemaReference associated with this descriptor
- See Also:
org.eclipse.persistence.oxm.schema
-
getTableNames
java.util.Vector getTableNames()
Return the table names.
-
getTables
java.util.Vector<TABLE> getTables()
INTERNAL: Return all the tables.
-
getTypedField
FIELD getTypedField(FIELD field)
INTERNAL: searches first descriptor than its ReturningPolicy for an equal field
-
hasInheritance
boolean hasInheritance()
INTERNAL: Return if this descriptor is involved in inheritance, (is child or parent). Note: If this class is part of table per class inheritance strategy this method will return false.- See Also:
hasTablePerClassPolicy()
-
isLazilyInitialized
boolean isLazilyInitialized()
If true, the descriptor may be lazily initialized. This is useful if the descriptor may not get used.
-
isResultAlwaysXMLRoot
boolean isResultAlwaysXMLRoot()
-
isSequencedObject
boolean isSequencedObject()
INTERNAL:Indicates if the Object mapped by this descriptor is a sequenced data object and should be marshalled accordingly.
-
isWrapper
boolean isWrapper()
-
setDefaultRootElement
void setDefaultRootElement(java.lang.String newDefaultRootElement)
Return the default root element name for the ClassDescriptor This value is stored in place of a table name This value is mandatory for all root objects- Parameters:
newDefaultRootElement- the default root element to specify on this ClassDescriptor
-
setInstantiationPolicy
void setInstantiationPolicy(INSTANTIATION_POLICY instantiationPolicy)
INTERNAL: Sets the instantiation policy.
-
setJavaClass
void setJavaClass(java.lang.Class theJavaClass)
Set the Java class that this descriptor maps. Every descriptor maps one and only one class.
-
setJavaClassName
void setJavaClassName(java.lang.String theJavaClassName)
INTERNAL: Return the java class name, used by the MW.
-
setLocationAccessor
void setLocationAccessor(ATTRIBUTE_ACCESSOR attributeAccessor)
INTERNAL: Set this Descriptor's location accessor.
-
setNamespaceResolver
void setNamespaceResolver(NAMESPACE_RESOLVER newNamespaceResolver)
Set the NamespaceResolver to associate with this descriptor- Parameters:
newNamespaceResolver- the NamespaceResolver to associate with this descriptor
-
setProperties
void setProperties(java.util.Map properties)
INTERNAL: Set the user defined properties.
-
setResultAlwaysXMLRoot
void setResultAlwaysXMLRoot(boolean resultAlwaysXMLRoot)
-
setSchemaReference
void setSchemaReference(XMLSchemaReference newSchemaReference)
Set the SchemaReference to associate with this descriptor- Parameters:
newSchemaReference- the SchemaReference to associate with this descriptor- See Also:
org.eclipse.persistence.oxm.schema
-
shouldPreserveDocument
boolean shouldPreserveDocument()
Return if unmapped information from the XML document should be maintained for this descriptor By default unmapped data is not preserved.- Returns:
- if this descriptor should preserve unmapped data
-
wrapObjectInXMLRoot
java.lang.Object wrapObjectInXMLRoot(java.lang.Object object, java.lang.String elementNamespaceUri, java.lang.String elementLocalName, java.lang.String elementPrefix, boolean forceWrap, boolean isNamespaceAware, UNMARSHALLER xmlUnmarshaller)INTERNAL: Determines the appropriate object to return from the unmarshal call. The method will either return the object created in the xmlReader.parse() call or an instance of XMLRoot. An XMLRoot instance will be returned if the DOMRecord element being unmarshalled does not equal the descriptor's default root element.- Parameters:
object-elementNamespaceUri-elementLocalName-elementPrefix-- Returns:
- object
-
wrapObjectInXMLRoot
java.lang.Object wrapObjectInXMLRoot(java.lang.Object object, java.lang.String elementNamespaceUri, java.lang.String elementLocalName, java.lang.String elementPrefix, java.lang.String encoding, java.lang.String version, boolean forceWrap, boolean isNamespaceAware, UNMARSHALLER unmarshaller)INTERNAL:
-
wrapObjectInXMLRoot
java.lang.Object wrapObjectInXMLRoot(UNMARSHAL_RECORD unmarshalRecord, boolean forceWrap)
INTERNAL: Determines the appropriate object to return from the unmarshal call. The method will either return the object created in the xmlReader.parse() call or an instance of XMLRoot. An XMLRoot instance will be returned if the DOMRecord element being unmarshalled does not equal the descriptor's default root element.- Parameters:
unmarshalRecord-- Returns:
- object
-
getAttributeGroup
CoreAttributeGroup getAttributeGroup(java.lang.String subgraph)
-
-