Oracle Fusion Middleware Java API Reference for Oracle TopLink (Deprecated)
11g Release 1 (11.1.1)

B32476-04

oracle.toplink.ox
Class XMLDescriptor

java.lang.Object
  extended by oracle.toplink.descriptors.ClassDescriptor
      extended by oracle.toplink.ox.XMLDescriptor
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class XMLDescriptor
extends ClassDescriptor

Use an XML project for nontransactional, nonpersistent (in-memory) conversions between Java objects and XML documents. An XMLDescriptor is a set of mappings that describe how an objects's data is to be represented in an XML document. XML descriptors describe Java objects that you map to simple and complex types defined by an XML schema document (XSD). Using XML descriptors in a TopLink XML project, you can configure XML mappings.

See Also:
oracle.toplink.ox.mappings, Serialized Form

Field Summary
 
Fields inherited from class oracle.toplink.descriptors.ClassDescriptor
DO_NOT_SEND_CHANGES, INVALIDATE_CHANGED_OBJECTS, ISOLATE_CACHE_AFTER_TRANSACTION, ISOLATE_CACHE_ALWAYS, ISOLATE_NEW_DATA_AFTER_TRANSACTION, SEND_NEW_OBJECTS_WITH_CHANGES, SEND_OBJECT_CHANGES, UNDEFINED_ISOLATATION, UNDEFINED_OBJECT_CHANGE_BEHAVIOR, USE_SESSION_CACHE_AFTER_TRANSACTION
 
Constructor Summary
XMLDescriptor()
          Return a new XMLDescriptor.
 
Method Summary
 DatabaseMapping addDirectMapping(java.lang.String attributeName, java.lang.String xpathString)
          Add a direct mapping to the receiver.
 DatabaseMapping addDirectMapping(java.lang.String attributeName, java.lang.String getMethodName, java.lang.String setMethodName, java.lang.String xpathString)
          Add a direct to node mapping to the receiver.
 void addRootElement(java.lang.String rootElementName)
          Add a root element name for the Descriptor This value is stored in place of a table name
 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
 XMLField getDefaultRootElementField()
           
 javax.xml.namespace.QName getDefaultRootElementType()
           
 InheritancePolicy getInheritancePolicy()
          The inheritance policy is used to define how a descriptor takes part in inheritance.
 NamespaceResolver getNamespaceResolver()
          Return the NamespaceResolver associated with this descriptor
 NamespaceResolver getNonNullNamespaceResolver()
           
 XMLSchemaReference getSchemaReference()
          Return the SchemaReference associated with this descriptor
 boolean isWrapper()
           
 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
 void setDefaultRootElementField(XMLField xmlField)
           
 void setDefaultRootElementType(javax.xml.namespace.QName type)
          The default root element type string will be stored until initialization - a QName will be created and stored on the default root element field during initialize.
 void setIsWrapper(boolean value)
           
 void setNamespaceResolver(NamespaceResolver newNamespaceResolver)
          Set the NamespaceResolver to associate with this descriptor
 void setSchemaReference(XMLSchemaReference newSchemaReference)
          Set the SchemaReference to associate with this descriptor
 void setSequencedObject(boolean isSequenced)
           
 void setShouldPreserveDocument(boolean shouldPreserveDocument)
          Specifies that object built from this descriptor should retain any unmapped information from their original XML Document when being written back out.
 boolean shouldPreserveDocument()
          Return if unmapped information from the XML document should be maintained for this descriptor By default unmapped data is not preserved.
 boolean shouldWrapObject(java.lang.Object object, java.lang.String elementNamespaceUri, java.lang.String elementLocalName, java.lang.String elementPrefix)
           
 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)
           
 
Methods inherited from class oracle.toplink.descriptors.ClassDescriptor
addAbstractQueryKey, addConstraintDependencies, addDirectQueryKey, addForeignKeyFieldForMultipleTable, addForeignKeyFieldNameForMultipleTable, addMapping, addMultipleTableForeignKeyField, addMultipleTableForeignKeyFieldName, addMultipleTablePrimaryKeyField, addMultipleTablePrimaryKeyFieldName, addPrimaryKeyField, addPrimaryKeyFieldName, addQueryKey, addTable, addTableName, alwaysConformResultsInUnitOfWork, alwaysRefreshCache, alwaysRefreshCacheOnRemote, applyAmendmentMethod, createCopyPolicy, createInstantiationPolicy, descriptorIsAggregate, descriptorIsAggregateCollection, descriptorIsForInterface, descriptorIsNormal, disableCacheHits, disableCacheHitsOnRemote, dontAlwaysConformResultsInUnitOfWork, dontAlwaysRefreshCache, dontAlwaysRefreshCacheOnRemote, dontDisableCacheHits, dontDisableCacheHitsOnRemote, dontOnlyRefreshCacheIfNewerVersion, getAlias, getAmendmentClass, getAmendmentMethodName, getCacheInvalidationPolicy, getCacheSynchronizationType, getCMPPolicy, getConstraintDependencies, getDescriptorEventManager, getDescriptorInheritancePolicy, getDescriptorQueryManager, getDescriptorType, getEventManager, getFetchGroupManager, getHistoryPolicy, getIdentityMapSize, getInterfacePolicy, getJavaClass, getJavaClassName, getMappingForAttributeName, getMappings, getObjectChangePolicy, getOptimisticLockingPolicy, getPrimaryKeyFieldNames, getProperties, getProperty, getQueryKeys, getQueryManager, getRemoteIdentityMapSize, getReturningPolicy, getSequenceNumberFieldName, getSequenceNumberName, getTableName, getTableNames, getUnitOfWorkCacheIsolationLevel, getWrapperPolicy, isAggregateCollectionDescriptor, isAggregateDescriptor, isChildDescriptor, isDescriptorForInterface, isIsolated, isNativeConnectionRequired, isObjectRelationalDescriptor, onlyRefreshCacheIfNewerVersion, removeMappingForAttributeName, removeProperty, setAlias, setAmendmentClass, setAmendmentMethodName, setCacheInvalidationPolicy, setCacheSynchronizationType, setCMPPolicy, setConstraintDependencies, setDefaultTableName, setDescriptorType, setFetchGroupManager, setHistoryPolicy, setIdentityMapClass, setIdentityMapSize, setIsIsolated, setIsNativeConnectionRequired, setJavaClass, setJavaInterface, setMultipleTableInsertOrder, setObjectChangePolicy, setOptimisticLockingPolicy, setPrimaryKeyFieldName, setPrimaryKeyFieldNames, setProperty, setReadOnly, setRemoteIdentityMapClass, setRemoteIdentityMapSize, setReturningPolicy, setSequenceNumberFieldName, setSequenceNumberName, setShouldAlwaysConformResultsInUnitOfWork, setShouldAlwaysRefreshCache, setShouldAlwaysRefreshCacheOnRemote, setShouldBeReadOnly, setShouldDisableCacheHits, setShouldDisableCacheHitsOnRemote, setShouldOnlyRefreshCacheIfNewerVersion, setShouldOrderMappings, setTableName, setTableNames, setTableQualifier, setUnitOfWorkCacheIsolationLevel, setWrapperPolicy, shouldAlwaysConformResultsInUnitOfWork, shouldAlwaysRefreshCache, shouldAlwaysRefreshCacheOnRemote, shouldBeReadOnly, shouldDisableCacheHits, shouldDisableCacheHitsOnRemote, shouldOnlyRefreshCacheIfNewerVersion, shouldUseCacheIdentityMap, shouldUseFullIdentityMap, shouldUseHardCacheWeakIdentityMap, shouldUseNoIdentityMap, shouldUseRemoteCacheIdentityMap, shouldUseRemoteFullIdentityMap, shouldUseRemoteHardCacheWeakIdentityMap, shouldUseRemoteNoIdentityMap, shouldUseRemoteSoftCacheWeakIdentityMap, shouldUseRemoteSoftIdentityMap, shouldUseRemoteWeakIdentityMap, shouldUseSoftCacheWeakIdentityMap, shouldUseSoftIdentityMap, shouldUseWeakIdentityMap, toString, useAllFieldsLocking, useCacheIdentityMap, useChangedFieldsLocking, useCloneCopyPolicy, useCloneCopyPolicy, useDefaultConstructorInstantiationPolicy, useFactoryInstantiationPolicy, useFactoryInstantiationPolicy, useFactoryInstantiationPolicy, useFullIdentityMap, useHardCacheWeakIdentityMap, useInstantiationCopyPolicy, useMethodInstantiationPolicy, useNoIdentityMap, useRemoteCacheIdentityMap, useRemoteFullIdentityMap, useRemoteHardCacheWeakIdentityMap, useRemoteNoIdentityMap, useRemoteSoftCacheWeakIdentityMap, useRemoteSoftIdentityMap, useRemoteWeakIdentityMap, useSelectedFieldsLocking, useSoftCacheWeakIdentityMap, useSoftIdentityMap, usesOptimisticLocking, usesSequenceNumbers, usesVersionLocking, useTimestampLocking, useTimestampLocking, useVersionLocking, useVersionLocking, useWeakIdentityMap
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XMLDescriptor

public XMLDescriptor()
Return a new XMLDescriptor.

Method Detail

getDefaultRootElement

public 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

shouldPreserveDocument

public 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 decriptor should preserve unmapped data

setShouldPreserveDocument

public void setShouldPreserveDocument(boolean shouldPreserveDocument)
Specifies that object built from this descriptor should retain any unmapped information from their original XML Document when being written back out. By default unmapped data is not preserved.


addRootElement

public 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

setDefaultRootElement

public 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

getNamespaceResolver

public NamespaceResolver getNamespaceResolver()
Return the NamespaceResolver associated with this descriptor

Returns:
the NamespaceResolver associated with this descriptor
See Also:
NamespaceResolver

getNonNullNamespaceResolver

public NamespaceResolver getNonNullNamespaceResolver()

getInheritancePolicy

public InheritancePolicy 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.

Overrides:
getInheritancePolicy in class ClassDescriptor
Returns:
the InheritancePolicy associated with this descriptor

setNamespaceResolver

public void setNamespaceResolver(NamespaceResolver newNamespaceResolver)
Set the NamespaceResolver to associate with this descriptor

Parameters:
newNamespaceResolver - the NamespaceResolver to associate with this descriptor
See Also:
NamespaceResolver

getSchemaReference

public XMLSchemaReference getSchemaReference()
Return the SchemaReference associated with this descriptor

Returns:
the SchemaReference associated with this descriptor
See Also:
oracle.toplink.ox.schema

setSchemaReference

public void setSchemaReference(XMLSchemaReference newSchemaReference)
Set the SchemaReference to associate with this descriptor

Parameters:
newSchemaReference - the SchemaReference to associate with this descriptor
See Also:
oracle.toplink.ox.schema

addDirectMapping

public DatabaseMapping addDirectMapping(java.lang.String attributeName,
                                        java.lang.String xpathString)
Add a direct mapping to the receiver. The new mapping specifies that an instance variable of the class of objects which the receiver describes maps in the default manner for its type to the indicated database field.

Overrides:
addDirectMapping in class ClassDescriptor
Parameters:
attributeName - the name of an instance variable of the class which the receiver describes.
xpathString - the xpath of the xml element or attribute which corresponds with the designated instance variable.
Returns:
The newly created DatabaseMapping is returned.

addDirectMapping

public DatabaseMapping addDirectMapping(java.lang.String attributeName,
                                        java.lang.String getMethodName,
                                        java.lang.String setMethodName,
                                        java.lang.String xpathString)
Add a direct to node mapping to the receiver. The new mapping specifies that a variable accessed by the get and set methods of the class of objects which the receiver describes maps in the default manner for its type to the indicated database field.

Overrides:
addDirectMapping in class ClassDescriptor

wrapObjectInXMLRoot

public 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)

shouldWrapObject

public boolean shouldWrapObject(java.lang.Object object,
                                java.lang.String elementNamespaceUri,
                                java.lang.String elementLocalName,
                                java.lang.String elementPrefix)

getDefaultRootElementField

public XMLField getDefaultRootElementField()

setDefaultRootElementField

public void setDefaultRootElementField(XMLField xmlField)

getDefaultRootElementType

public javax.xml.namespace.QName getDefaultRootElementType()

setDefaultRootElementType

public void setDefaultRootElementType(javax.xml.namespace.QName type)
The default root element type string will be stored until initialization - a QName will be created and stored on the default root element field during initialize.

Parameters:
type -

setSequencedObject

public void setSequencedObject(boolean isSequenced)

isWrapper

public boolean isWrapper()

setIsWrapper

public void setIsWrapper(boolean value)

Copyright © 1998, 2012, Oracle. All Rights Reserved.