java.lang.Object
org.eclipse.persistence.internal.oxm.Root
- Direct Known Subclasses:
XMLRoot
Root is used to hold an Object along with the corresponding QName and some other related information. Typically this is used when the object is marshalled/unmarshalled to a QName other than the defaultRootElement set on the Descriptor.
Root objects can be returned from Unmarshaller unmarshal operations and can be given to Marshaller.marshal operations. They may also be in values returned by AnyCollectionMappings and AnyObjectMappings.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Class
<?> Gets the declared type.Gets the encoding which will be set on the XMLRoot during unmarshal.Gets the local name.Gets the namespace uri.Gets the no namespace schema location which will be set on the XMLRoot during unmarshal.Gets the object.Gets the schema location which will be set on the XMLRoot during unmarshal.Gets the schema type.Gets the XML version which will be set on the XMLRoot during unmarshal.int
hashCode()
boolean
isNil()
Checks if is nil.void
setDeclaredType
(Class<?> type) Sets the declared type.void
setEncoding
(String encoding) Sets the encoding.void
setLocalName
(String name) Set the element name.void
setNamespaceURI
(String rootElementUri) Sets the namespace uri associated with the QName of this XMLRoot.void
setNil
(boolean nil) Sets that this XMLRoot object is nil.void
setNoNamespaceSchemaLocation
(String noNamespaceSchemaLocation) Sets the no namespace schema location.void
Sets the object associated with this XMLRoot.void
setSchemaLocation
(String schemaLocation) Sets the schema location.void
setSchemaType
(QName schemaType) Sets the schema type that should be associated with this XMLRoot object.void
setVersion
(String version) Sets the version.
-
Field Details
-
rootObject
-
localName
-
namespaceUri
-
prefix
-
encoding
-
xmlVersion
-
schemaLocation
-
noNamespaceSchemaLocation
-
schemaType
-
declaredType
-
nil
protected boolean nil
-
-
Constructor Details
-
Root
public Root()Default constructor.
-
-
Method Details
-
getObject
Gets the object. This may be null.- Returns:
- the object
-
getLocalName
Gets the local name. This should not be null.- Returns:
- the local name
-
getNamespaceURI
Gets the namespace uri. This may be null.- Returns:
- the namespace uri
-
setObject
Sets the object associated with this XMLRoot. This may be null.- Parameters:
rootObject
- The object to associate with this XMLRoot.
-
setLocalName
Set the element name. This method will parse the qualified name in an attempt to set the localName fields. ie: this could be set to "someLocalName" or "somePrefix:someLocalName"- Parameters:
name
- the new local name
-
setNamespaceURI
Sets the namespace uri associated with the QName of this XMLRoot.- Parameters:
rootElementUri
- the new namespace uri
-
getEncoding
Gets the encoding which will be set on the XMLRoot during unmarshal.- Returns:
- the encoding
-
setEncoding
Sets the encoding.- Parameters:
encoding
- the new encoding
-
getXMLVersion
Gets the XML version which will be set on the XMLRoot during unmarshal.- Returns:
- the XML version
-
setVersion
Sets the version.- Parameters:
version
- the new version
-
getSchemaLocation
Gets the schema location which will be set on the XMLRoot during unmarshal.- Returns:
- the schema location
-
setSchemaLocation
Sets the schema location.- Parameters:
schemaLocation
- the new schema location
-
getNoNamespaceSchemaLocation
Gets the no namespace schema location which will be set on the XMLRoot during unmarshal.- Returns:
- the no namespace schema location
-
setNoNamespaceSchemaLocation
Sets the no namespace schema location.- Parameters:
noNamespaceSchemaLocation
- the new no namespace schema location
-
setSchemaType
Sets the schema type that should be associated with this XMLRoot object.- Parameters:
schemaType
- the new schema type
-
getSchemaType
Gets the schema type. This schema type will be considering when marshalling XMLRoot objects.- Returns:
- the schema type associated with this XMLRoot object or null.
-
setDeclaredType
Sets the declared type. This may be different than the getObject().getClass(), for example, in the case where inheritance is used the declared type may be the super class and the actual object could be a subclass.- Parameters:
type
- The declared type of this XMLRoot object.
-
getDeclaredType
Gets the declared type. This may be different than the getObject().getClass(), for example, in the case where inheritance is used the declared type may be the super class and the actual object could be a subclass.- Returns:
- the declared type
-
isNil
public boolean isNil()Checks if is nil. Returns true if this XMLRoot has been explicitly set to nil or if xmlRoot.getObject() is null.- Returns:
- true, if is nil
-
setNil
public void setNil(boolean nil) Sets that this XMLRoot object is nil. If setNil(true) is explicitly called then isNil() will return true even if rootObject is not null. -
equals
-
hashCode
public int hashCode()
-