public abstract class Content extends java.lang.Object implements java.io.Serializable, NamespaceAware
Parent
nodes.限定符和类型 | 类和说明 |
---|---|
static class |
Content.CType
An enumeration useful for identifying content types without
having to do instanceof type conditionals.
|
限定符和类型 | 方法和说明 |
---|---|
Content |
clone()
Return a deep clone of this instance.
|
Content |
detach()
Detaches this child from its parent or does nothing if the child
has no parent.
|
boolean |
equals(java.lang.Object ob)
This tests for equality of this Content object to the supplied object.
|
Content.CType |
getCType()
All content has an enumerated type expressing the type of content.
|
Document |
getDocument()
Return this child's owning document or null if the branch containing
this child is currently not attached to a document.
|
java.util.List<Namespace> |
getNamespacesInherited()
Obtain a list of all namespaces that are in scope for this content, but
were not introduced by this content.
|
java.util.List<Namespace> |
getNamespacesInScope()
Obtain a list of all namespaces that are in scope for the current
content.
|
java.util.List<Namespace> |
getNamespacesIntroduced()
Obtain a list of all namespaces that are introduced to the XML tree by
this node.
|
Parent |
getParent()
Return this child's parent, or null if this child is currently
not attached.
|
Element |
getParentElement()
A convenience method that returns any parent element for this element,
or null if the element is unattached or is a root element.
|
abstract java.lang.String |
getValue()
Returns the XPath 1.0 string value of this child.
|
int |
hashCode()
This returns the hash code for this
Content item. |
public final Content.CType getCType()
public Content detach()
This method can be overridden by particular Content subclasses to return
a specific type of Content (co-variant return type). All overriding
subclasses must call super.detach()
;
public Parent getParent()
Element
or a Document
.
This method can be overridden by particular Content subclasses to return
a specific type of Parent (co-variant return type). All overriding
subclasses must call super.getParent()
;
public final Element getParentElement()
public Document getDocument()
public abstract java.lang.String getValue()
public Content clone()
All JDOM core classes are Cloneable, and never throw CloneNotSupportedException. Additionally all Cloneable JDOM classes return the correct type of instance from this method and there is no need to cast the result (co-variant return vaue).
Subclasses of this should still call super.clone() in their clone method.
public final boolean equals(java.lang.Object ob)
equals
在类中 java.lang.Object
ob
- Object
to compare to.boolean
- whether the Content
is
equal to the supplied Object
.public final int hashCode()
Content
item.hashCode
在类中 java.lang.Object
int
- hash code.public java.util.List<Namespace> getNamespacesInScope()
NamespaceAware
The contents of this list will always be the combination of getNamespacesIntroduced() and getNamespacesInherited().
See NamespaceAware
documentation for details on what the order of the
Namespaces will be in the returned list.
getNamespacesInScope
在接口中 NamespaceAware
public java.util.List<Namespace> getNamespacesIntroduced()
NamespaceAware
The contents of this list will always be a subset (but in the same order) of getNamespacesInScope(), and will never intersect getNamspacesInherited()
getNamespacesIntroduced
在接口中 NamespaceAware
public java.util.List<Namespace> getNamespacesInherited()
NamespaceAware
The contents of this list will always be a subset (but in the same order) of getNamespacesInScope(), and will never intersect getNamspacesIntroduced()
getNamespacesInherited
在接口中 NamespaceAware