org.jdom2.Parent nodes.
org.jdom2.Comment , org.jdom2.DocType , org.jdom2.Element , org.jdom2.EntityRef , org.jdom2.Parent , org.jdom2.ProcessingInstruction , org.jdom2.Text
| Modifier and Type | Class and Description |
|---|---|
| public static enum | Content.CType
An enumeration useful for identifying content types without
having to do |
| Modifier and Type | Field and Description |
|---|---|
| protected final Content. | ctype
The content type enumerate value for this Content |
| protected transient Parent | |
| private static final long | serialVersionUID
JDOM2 Serialization. |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public Content | |
| public Content | Returns: this child detachedDetaches this child from its parent or does nothing if the child has no parent. |
| public final boolean | Returns: boolean - whether the Content is
equal to the supplied Object.Object to compare to.Overrides java. |
| public final Content. | Returns: A CType enumerated value representing this content.All content has an enumerated type expressing the type of content. |
| public Document | Returns: this child's owning document or null if noneReturn this child's owning document or null if the branch containing this child is currently not attached to a document. |
| public List | getNamespacesInherited()
Implements org. |
| public List | getNamespacesInScope()
Implements org. |
| public List | getNamespacesIntroduced()
Implements org. |
| public Parent | Returns: this child's parent or null if noneReturn this child's parent, or null if this child is currently not attached. |
| public final Element | Returns: the containing Element or null if unattached or a root elementA convenience method that returns any parent element for this element, or null if the element is unattached or is a root element. |
| public abstract String | Returns: xpath string value of this child.Returns the XPath 1.0 string value of this child. |
| public final int | Returns: int - hash code.Overrides java. Content item.
|
| protected Content |
| ctype | back to summary |
|---|---|
| protected final Content. The content type enumerate value for this Content
| |
| parent | back to summary |
|---|---|
| protected transient Parent parent The parent | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID JDOM2 Serialization. | |
| Content | back to summary |
|---|---|
| protected Content(Content. Create a new Content instance of a particular type. | |
| clone | back to summary |
|---|---|
| public Content clone() Overrides org. Doc from org. Return a deep clone of this instance. Even if this instance has a parent, the returned clone will not. 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 value). Subclasses of this should still call super.clone() in their clone method.
| |
| detach | back to summary |
|---|---|
| public Content detach() Detaches this child from its parent or does nothing if the child has no 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
| |
| equals | back to summary |
|---|---|
| public final boolean equals(Object ob) Overrides java. This tests for equality of this Content object to the supplied object. Content items are considered equal only if they are referentially equal (i.e. the same object). User code may choose to compare objects based on their properties instead. | |
| getCType | back to summary |
|---|---|
| public final Content. All content has an enumerated type expressing the type of content. This makes it possible to use switch-type statements on the content. | |
| getDocument | back to summary |
|---|---|
| public Document getDocument() Return this child's owning document or null if the branch containing this child is currently not attached to a document.
| |
| getNamespacesInherited | back to summary |
|---|---|
| public List Implements org. Doc from org. Obtain a list of all namespaces that are in scope for this content, but were not introduced by this content. The contents of this list will always be a subset (but in the same order) of getNamespacesInScope(), and will never intersect getNamspacesIntroduced() | |
| getNamespacesInScope | back to summary |
|---|---|
| public List Implements org. Doc from org. Obtain a list of all namespaces that are in scope for the current content. The contents of this list will always be the combination of getNamespacesIntroduced() and getNamespacesInherited().
See | |
| getNamespacesIntroduced | back to summary |
|---|---|
| public List Implements org. Doc from org. Obtain a list of all namespaces that are introduced to the XML tree by this node. Only Elements and Attributes can introduce namespaces, so all other Content types will return an empty list. The contents of this list will always be a subset (but in the same order) of getNamespacesInScope(), and will never intersect getNamspacesInherited() | |
| getParent | back to summary |
|---|---|
| public Parent getParent() Return this child's parent, or null if this child is currently
not attached. The parent can be either an
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
| |
| getParentElement | back to summary |
|---|---|
| public final 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. This was the original behavior of getParent() in JDOM Beta 9 which began returning Parent in Beta 10. This method provides a convenient upgrade path for JDOM Beta 10 and 1.0 users.
| |
| getValue | back to summary |
|---|---|
| public abstract String getValue() Returns the XPath 1.0 string value of this child.
| |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Overrides java. This returns the hash code for this
| |
| setParent | back to summary |
|---|---|
| protected Content setParent(Parent parent) Sets the parent of this Content. The caller is responsible for removing any pre-existing parentage.
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 | |
instanceof type conditionals.
instanceof is not a particularly safe way to test content
in JDOM because CDATA extends Text ( a CDATA instance is an
instanceof Text).
This CType enumeration provides a direct and sure mechanism for identifying JDOM content.
These can be used in switch-type statements too (which is much neater than chained if (instanceof) else if (instanceof) else .... expressions):
switch(content.getCType()) {
case Text :
.....
break;
case CDATA :
.....
break;
....
}
| Modifier and Type | Field and Description |
|---|---|
| public static final Content. | |
| public static final Content. | |
| public static final Content. | |
| public static final Content. | |
| public static final Content. | |
| public static final Content. | ProcessingInstruction
Represents |
| public static final Content. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Content. | |
| public static Content. |
| CDATA | back to summary |
|---|---|
| public static final Content. Represents | |
| Comment | back to summary |
|---|---|
| public static final Content. Represents | |
| DocType | back to summary |
|---|---|
| public static final Content. Represents | |
| Element | back to summary |
|---|---|
| public static final Content. Represents | |
| EntityRef | back to summary |
|---|---|
| public static final Content. Represents | |
| ProcessingInstruction | back to summary |
|---|---|
| public static final Content. Represents | |
| Text | back to summary |
|---|---|
| public static final Content. Represents | |
| CType | back to summary |
|---|---|
| private CType() | |
| valueOf | back to summary |
|---|---|
| public static Content. | |
| values | back to summary |
|---|---|
| public static Content. | |