|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.persistence.descriptors.ClassDescriptor
org.eclipse.persistence.oxm.XMLDescriptor
public class XMLDescriptor
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 an EclipseLink XML project, you can configure XML mappings.
org.eclipse.persistence.oxm.mappings
,
Serialized FormField Summary |
---|
Fields inherited from class org.eclipse.persistence.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, shouldUseFullChangeSetsForNewObjects, UNDEFINED_ISOLATATION, UNDEFINED_OBJECT_CHANGE_BEHAVIOR, USE_SESSION_CACHE_AFTER_TRANSACTION |
Constructor Summary | |
---|---|
XMLDescriptor()
PUBLIC: Return a new XMLDescriptor. |
Method Summary | |
---|---|
DatabaseMapping |
addDirectMapping(java.lang.String attributeName,
java.lang.String xpathString)
PUBLIC: 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)
PUBLIC: Add a direct to node mapping to the receiver. |
void |
addPrimaryKeyField(org.eclipse.persistence.internal.helper.DatabaseField field)
ADVANCED: Specify the primary key field of the descriptors table. |
void |
addPrimaryKeyFieldName(java.lang.String fieldName)
PUBLIC: Specify the primary key field of the descriptors table. |
void |
addRootElement(java.lang.String rootElementName)
PUBLIC: Add a root element name for the Descriptor This value is stored in place of a table name |
java.util.Vector |
buildDirectValuesFromFieldValue(java.lang.Object fieldValue)
INTERNAL: Extract the direct values from the specified field value. |
org.eclipse.persistence.internal.helper.DatabaseField |
buildField(org.eclipse.persistence.internal.helper.DatabaseField field)
INTERNAL: This is used only in initialization. |
org.eclipse.persistence.internal.helper.DatabaseField |
buildField(java.lang.String fieldName)
INTERNAL: A DatabaseField is built from the given field name. |
java.lang.Object |
buildFieldValueFromDirectValues(java.util.Vector directValues,
java.lang.String elementDataTypeName,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Build the appropriate field value for the specified set of direct values. |
java.lang.Object |
buildFieldValueFromNestedRows(java.util.Vector nestedRows,
java.lang.String structureName,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Build and return the appropriate field value for the specified set of nested rows. |
org.eclipse.persistence.internal.sessions.AbstractRecord |
buildNestedRowFromFieldValue(java.lang.Object fieldValue)
INTERNAL: Build(if necessary) and return the nested XMLRecord from the specified field value. |
java.util.Vector |
buildNestedRowsFromFieldValue(java.lang.Object fieldValue,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Build(if necessary) and return a Vector of the nested XMLRecords from the specified field value. |
java.lang.String |
getDefaultRootElement()
PUBLIC: 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()
PUBLIC: The inheritance policy is used to define how a descriptor takes part in inheritance. |
NamespaceResolver |
getNamespaceResolver()
PUBLIC: Return the NamespaceResolver associated with this descriptor |
NamespaceResolver |
getNonNullNamespaceResolver()
|
XMLSchemaReference |
getSchemaReference()
PUBLIC: Return the SchemaReference associated with this descriptor |
org.eclipse.persistence.internal.helper.DatabaseField |
getTypedField(org.eclipse.persistence.internal.helper.DatabaseField field)
INTERNAL: searches first descriptor than its ReturningPolicy for an equal field |
void |
initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Initialize the mappings as a separate step. |
void |
initializeAggregateInheritancePolicy(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: This is needed by regular aggregate descriptors (because they require review); but not by XML aggregate descriptors. |
boolean |
isResultAlwaysXMLRoot()
|
boolean |
isSequencedObject()
INTERNAL: |
boolean |
isWrapper()
|
void |
postInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Post initializations after mappings are initialized. |
void |
preInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Allow the descriptor to initialize any dependencies on this session. |
boolean |
requiresInitialization()
INTERNAL: XML descriptors are initialized normally, since they do not need to be cloned by XML aggregate mappings. |
void |
setDefaultRootElement(java.lang.String newDefaultRootElement)
PUBLIC: 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)
PUBLIC: Set the NamespaceResolver to associate with this descriptor |
void |
setPrimaryKeyFields(java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> thePrimaryKeyFields)
INTERNAL: Set the primary key fields |
void |
setResultAlwaysXMLRoot(boolean resultAlwaysXMLRoot)
|
void |
setSchemaReference(XMLSchemaReference newSchemaReference)
PUBLIC: Set the SchemaReference to associate with this descriptor |
void |
setSequencedObject(boolean isSequenced)
|
void |
setShouldPreserveDocument(boolean shouldPreserveDocument)
PUBLIC: Specifies that object built from this descriptor should retain any unmapped information from their original XML Document when being written back out. |
void |
setTableNames(java.util.Vector tableNames)
PUBLIC: Specify the all table names for the class of objects the receiver describes. |
void |
setTables(java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseTable> theTables)
INTERNAL: Sets the tables |
boolean |
shouldPreserveDocument()
PUBLIC: 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,
boolean forceWrap)
INTERNAL: Determines the appropriate object to return from the unmarshal call. |
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)
|
java.lang.Object |
wrapObjectInXMLRoot(UnmarshalRecord unmarshalRecord,
boolean forceWrap)
INTERNAL: Determines the appropriate object to return from the unmarshal call. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public XMLDescriptor()
Method Detail |
---|
public java.lang.String getDefaultRootElement()
public boolean shouldPreserveDocument()
public void setShouldPreserveDocument(boolean shouldPreserveDocument)
public void addRootElement(java.lang.String rootElementName)
rootElementName
- a root element to specify on this Descriptorpublic void setDefaultRootElement(java.lang.String newDefaultRootElement)
newDefaultRootElement
- the default root element to specify on this ClassDescriptorpublic NamespaceResolver getNamespaceResolver()
NamespaceResolver
public NamespaceResolver getNonNullNamespaceResolver()
public InheritancePolicy getInheritancePolicy()
getInheritancePolicy
in class ClassDescriptor
public void setNamespaceResolver(NamespaceResolver newNamespaceResolver)
newNamespaceResolver
- the NamespaceResolver to associate with this descriptorNamespaceResolver
public XMLSchemaReference getSchemaReference()
org.eclipse.persistence.oxm.schema
public void setSchemaReference(XMLSchemaReference newSchemaReference)
newSchemaReference
- the SchemaReference to associate with this descriptororg.eclipse.persistence.oxm.schema
public org.eclipse.persistence.internal.sessions.AbstractRecord buildNestedRowFromFieldValue(java.lang.Object fieldValue)
buildNestedRowFromFieldValue
in class ClassDescriptor
public java.util.Vector buildNestedRowsFromFieldValue(java.lang.Object fieldValue, org.eclipse.persistence.internal.sessions.AbstractSession session)
buildNestedRowsFromFieldValue
in class ClassDescriptor
public DatabaseMapping addDirectMapping(java.lang.String attributeName, java.lang.String xpathString)
addDirectMapping
in class ClassDescriptor
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.
public DatabaseMapping addDirectMapping(java.lang.String attributeName, java.lang.String getMethodName, java.lang.String setMethodName, java.lang.String xpathString)
addDirectMapping
in class ClassDescriptor
public void addPrimaryKeyFieldName(java.lang.String fieldName)
ClassDescriptor
addPrimaryKeyFieldName
in class ClassDescriptor
#addMultipleTableForeignKeyFieldName(String, String);
public void addPrimaryKeyField(org.eclipse.persistence.internal.helper.DatabaseField field)
ClassDescriptor
addPrimaryKeyField
in class ClassDescriptor
public void setPrimaryKeyFields(java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> thePrimaryKeyFields)
ClassDescriptor
setPrimaryKeyFields
in class ClassDescriptor
public java.util.Vector buildDirectValuesFromFieldValue(java.lang.Object fieldValue) throws DatabaseException
buildDirectValuesFromFieldValue
in class ClassDescriptor
DatabaseException
public java.lang.Object buildFieldValueFromDirectValues(java.util.Vector directValues, java.lang.String elementDataTypeName, org.eclipse.persistence.internal.sessions.AbstractSession session) throws DatabaseException
buildFieldValueFromDirectValues
in class ClassDescriptor
DatabaseException
public java.lang.Object buildFieldValueFromNestedRows(java.util.Vector nestedRows, java.lang.String structureName, org.eclipse.persistence.internal.sessions.AbstractSession session) throws DatabaseException
buildFieldValueFromNestedRows
in class ClassDescriptor
DatabaseException
public org.eclipse.persistence.internal.helper.DatabaseField buildField(java.lang.String fieldName)
buildField
in class ClassDescriptor
public org.eclipse.persistence.internal.helper.DatabaseField buildField(org.eclipse.persistence.internal.helper.DatabaseField field)
buildField
in class ClassDescriptor
public void initializeAggregateInheritancePolicy(org.eclipse.persistence.internal.sessions.AbstractSession session)
initializeAggregateInheritancePolicy
in class ClassDescriptor
public void setTableNames(java.util.Vector tableNames)
ClassDescriptor
setTableNames
in class ClassDescriptor
public void setTables(java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseTable> theTables)
setTables
in class ClassDescriptor
public void preInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorException
preInitialize
in class ClassDescriptor
DescriptorException
public void postInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorException
postInitialize
in class ClassDescriptor
DescriptorException
public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorException
initialize
in class ClassDescriptor
DescriptorException
public boolean requiresInitialization()
requiresInitialization
in class ClassDescriptor
public java.lang.Object wrapObjectInXMLRoot(UnmarshalRecord unmarshalRecord, boolean forceWrap)
unmarshalRecord
-
public java.lang.Object wrapObjectInXMLRoot(java.lang.Object object, java.lang.String elementNamespaceUri, java.lang.String elementLocalName, java.lang.String elementPrefix, boolean forceWrap)
object
- elementNamespaceUri
- elementLocalName
- elementPrefix
-
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)
public boolean shouldWrapObject(java.lang.Object object, java.lang.String elementNamespaceUri, java.lang.String elementLocalName, java.lang.String elementPrefix)
public XMLField getDefaultRootElementField()
public void setDefaultRootElementField(XMLField xmlField)
public javax.xml.namespace.QName getDefaultRootElementType()
public void setDefaultRootElementType(javax.xml.namespace.QName type)
type
- public boolean isSequencedObject()
Indicates if the Object mapped by this descriptor is a sequenced data object and should be marshalled accordingly.
public void setSequencedObject(boolean isSequenced)
public boolean isWrapper()
public void setIsWrapper(boolean value)
public boolean isResultAlwaysXMLRoot()
public void setResultAlwaysXMLRoot(boolean resultAlwaysXMLRoot)
public org.eclipse.persistence.internal.helper.DatabaseField getTypedField(org.eclipse.persistence.internal.helper.DatabaseField field)
ClassDescriptor
getTypedField
in class ClassDescriptor
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |