Package org.jdom
Class Content
java.lang.Object
org.jdom.Content
- All Implemented Interfaces:
Serializable
,Cloneable
Superclass for JDOM objects which can be legal child content
of
Parent
nodes.- Version:
- $Revision: 1.6 $, $Date: 2007/11/10 05:28:58 $
- Author:
- Bradley S. Huffman, Jason Hunter
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
Returns a deep, unattached copy of this child and its descendants detached from any parent or document.detach()
Detaches this child from its parent or does nothing if the child has no parent.final boolean
This tests for equality of this Content object to the supplied object.Return this child's owning document or null if the branch containing this child is currently not attached to a document.Return this child's parent, or null if this child is currently not attached.A convenience method that returns any parent element for this element, or null if the element is unattached or is a root element.abstract String
getValue()
Returns the XPath 1.0 string value of this child.final int
hashCode()
This returns the hash code for thisContent
item.protected Content
Sets the parent of this Content.
-
Field Details
-
parent
-
-
Constructor Details
-
Content
protected Content()
-
-
Method Details
-
detach
Detaches this child from its parent or does nothing if the child has no parent.- Returns:
- this child detached
-
getParent
Return this child's parent, or null if this child is currently not attached. The parent can be either anElement
or aDocument
.- Returns:
- this child's parent or null if none
-
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.- Returns:
- the containing Element or null if unattached or a root element
-
setParent
Sets the parent of this Content. The caller is responsible for removing any pre-existing parentage.- Parameters:
parent
- new parent element- Returns:
- the target element
-
getDocument
Return this child's owning document or null if the branch containing this child is currently not attached to a document.- Returns:
- this child's owning document or null if none
-
getValue
Returns the XPath 1.0 string value of this child.- Returns:
- xpath string value of this child.
-
clone
Returns a deep, unattached copy of this child and its descendants detached from any parent or document. -
equals
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. -
hashCode
public final int hashCode()This returns the hash code for thisContent
item.
-