Module org.eclipse.persistence.core
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
Modifier and TypeMethodDescriptionaddMapping
(CORE_MAPPING mapping) Add a database mapping to the receiver.void
addPrimaryKeyField
(FIELD field) ADVANCED: Specify the primary key field of the descriptors table.void
addRootElement
(String rootElementName) Add a root element name for the Descriptor This value is stored in place of a table namegetAlias()
Get the aliasgetAttributeGroup
(String subgraph) 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 objectsThe inheritance policy is used to define how a descriptor takes part in inheritance.INTERNAL: Return the inheritance policy.INTERNAL: Returns the instantiation policy.<T> Class
<T> Return the java class.Return the class name, used by the MW.INTERNAL: Returns this Descriptor's location accessor, if one is defined.getMappingForAttributeName
(String attributeName) Returns the mapping associated with a given attribute name.Returns mappingsReturn the NamespaceResolver associated with this descriptorINTERNAL: Return the object builderReturn the names of all the primary keys.INTERNAL: Return all the primary key fieldsReturn the SchemaReference associated with this descriptorReturn the table names.INTERNAL: Return all the tables.getTypedField
(FIELD field) INTERNAL: searches first descriptor than its ReturningPolicy for an equal fieldboolean
INTERNAL: Return if this descriptor is involved in inheritance, (is child or parent).boolean
If true, the descriptor may be lazily initialized.boolean
boolean
INTERNAL:boolean
void
setDefaultRootElement
(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 objectsvoid
setInstantiationPolicy
(INSTANTIATION_POLICY instantiationPolicy) INTERNAL: Sets the instantiation policy.void
setJavaClass
(Class<?> theJavaClass) Set the Java class that this descriptor maps.void
setJavaClassName
(String theJavaClassName) INTERNAL: Return the java class name, used by the MW.void
setLocationAccessor
(ATTRIBUTE_ACCESSOR attributeAccessor) INTERNAL: Set this Descriptor's location accessor.void
setNamespaceResolver
(NAMESPACE_RESOLVER newNamespaceResolver) Set the NamespaceResolver to associate with this descriptorvoid
setProperties
(Map properties) INTERNAL: Set the user defined properties.void
setResultAlwaysXMLRoot
(boolean resultAlwaysXMLRoot) void
setSchemaReference
(XMLSchemaReference newSchemaReference) Set the SchemaReference to associate with this descriptorboolean
Return if unmapped information from the XML document should be maintained for this descriptor By default unmapped data is not preserved.wrapObjectInXMLRoot
(Object object, String elementNamespaceUri, String elementLocalName, String elementPrefix, boolean forceWrap, boolean isNamespaceAware, UNMARSHALLER xmlUnmarshaller) INTERNAL: Determines the appropriate object to return from the unmarshal call.wrapObjectInXMLRoot
(Object object, String elementNamespaceUri, String elementLocalName, String elementPrefix, String encoding, String version, boolean forceWrap, boolean isNamespaceAware, UNMARSHALLER unmarshaller) INTERNAL:wrapObjectInXMLRoot
(UNMARSHAL_RECORD unmarshalRecord, boolean forceWrap) INTERNAL: Determines the appropriate object to return from the unmarshal call.
-
Method Details
-
addMapping
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
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
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
String getAlias()Get the alias -
getDefaultRootElement
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
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
Return the java class. -
getJavaClassName
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
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
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
Return the names of all the primary keys. -
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:
-
getTableNames
Vector getTableNames()Return the table names. -
getTables
INTERNAL: Return all the tables. -
getTypedField
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. -
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
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
INTERNAL: Sets the instantiation policy. -
setJavaClass
Set the Java class that this descriptor maps. Every descriptor maps one and only one class. -
setJavaClassName
INTERNAL: Return the java class name, used by the MW. -
setLocationAccessor
INTERNAL: Set this Descriptor's location accessor. -
setNamespaceResolver
Set the NamespaceResolver to associate with this descriptor- Parameters:
newNamespaceResolver
- the NamespaceResolver to associate with this descriptor
-
setProperties
INTERNAL: Set the user defined properties. -
setResultAlwaysXMLRoot
void setResultAlwaysXMLRoot(boolean resultAlwaysXMLRoot) -
setSchemaReference
Set the SchemaReference to associate with this descriptor- Parameters:
newSchemaReference
- the SchemaReference to associate with this descriptor- See Also:
-
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
Object wrapObjectInXMLRoot(Object object, String elementNamespaceUri, String elementLocalName, 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.- Returns:
- object
-
wrapObjectInXMLRoot
Object wrapObjectInXMLRoot(Object object, String elementNamespaceUri, String elementLocalName, String elementPrefix, String encoding, String version, boolean forceWrap, boolean isNamespaceAware, UNMARSHALLER unmarshaller) INTERNAL: -
wrapObjectInXMLRoot
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.- Returns:
- object
-
getAttributeGroup
-