|
EclipseLink 1.0_1.0 M7 - 20080508 API Reference - Incubation | ||||||||
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 a TopLink XML project, you can configure XML mappings.
org.eclipse.persistence.oxm.mappings
,
Serialized FormField Summary |
---|
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 |
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. |
protected org.eclipse.persistence.internal.helper.DatabaseTable |
extractDefaultTable()
Aggregates use a dummy table as default. |
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 |
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 are screwed up); but not by XML aggregate descriptors. |
boolean |
isSequencedObject()
INTERNAL: Indicates if the Object mapped by this descriptor is a sequenced data object and should be marshalled accordingly. |
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 |
setNamespaceResolver(NamespaceResolver newNamespaceResolver)
PUBLIC: Set the NamespaceResolver to associate with this descriptor |
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. |
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)
|
protected void |
validateMappingType(DatabaseMapping mapping)
|
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, finalize, 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
protected void validateMappingType(DatabaseMapping mapping)
validateMappingType
in class ClassDescriptor
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 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 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
protected org.eclipse.persistence.internal.helper.DatabaseTable extractDefaultTable()
extractDefaultTable
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)
|
EclipseLink 1.0_1.0 M7 - 20080508 API Reference - Incubation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |