|
JDOM 2.0.2 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jdom2.Content
public abstract class Content
Superclass for JDOM objects which can be legal child content
of Parent nodes.
Comment,
DocType,
Element,
EntityRef,
Parent,
ProcessingInstruction,
Text,
Serialized Form| Nested Class Summary | |
|---|---|
static class |
Content.CType
An enumeration useful for identifying content types without having to do instanceof type conditionals. |
| Field Summary | |
|---|---|
protected Content.CType |
ctype
The content type enumerate value for this Content |
protected Parent |
parent
The parent Parent of this Content. |
| Constructor Summary | |
|---|---|
protected |
Content(Content.CType type)
Create a new Content instance of a particular type. |
| Method Summary | |
|---|---|
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. |
protected Content |
setParent(Parent parent)
Sets the parent of this Content. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected transient Parent parent
Parent of this Content.
Note that the field is not serialized, thus deserialized Content
instances are 'detached'
protected final Content.CType ctype
| Constructor Detail |
|---|
protected Content(Content.CType type)
type - The Content.CType of this Content| Method Detail |
|---|
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()
protected Content setParent(Parent parent)
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.setParent(Parent);
parent - new parent element
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 in class java.lang.Objectob - Object to compare to.
boolean - whether the Content is
equal to the supplied Object.public final int hashCode()
Content item.
hashCode in class java.lang.Objectint - hash code.public java.util.List<Namespace> getNamespacesInScope()
NamespaceAwareThe 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 in interface NamespaceAwarepublic java.util.List<Namespace> getNamespacesIntroduced()
NamespaceAwareThe contents of this list will always be a subset (but in the same order) of getNamespacesInScope(), and will never intersect getNamspacesInherited()
getNamespacesIntroduced in interface NamespaceAwarepublic java.util.List<Namespace> getNamespacesInherited()
NamespaceAwareThe contents of this list will always be a subset (but in the same order) of getNamespacesInScope(), and will never intersect getNamspacesIntroduced()
getNamespacesInherited in interface NamespaceAware
|
JDOM 2.0.2 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||