Top Description Fields Constructors Methods
org.jdom

public abstract Class Content

extends Object
implements Cloneable, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, java.lang.Cloneable
Known Direct Subclasses
org.jdom.DocType, org.jdom.Element, org.jdom.EntityRef, org.jdom.ProcessingInstruction, org.jdom.Text, org.jdom.Comment
Imports
java.io.*

Superclass for JDOM objects which can be legal child content of org.jdom.Parent nodes.
Authors
Bradley S. Huffman, Jason Hunter
Version
$Revision: 1.6 $, $Date: 2007/11/10 05:28:58 $
See Also
org.jdom.Comment, org.jdom.DocType, org.jdom.Element, org.jdom.EntityRef, org.jdom.Parent, org.jdom.ProcessingInstruction, org.jdom.Text

Field Summary

Modifier and TypeField and Description
protected Parent

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

a detached deep copy of this child and descendants
clone
()

Overrides java.lang.Object.clone.

Returns a deep, unattached copy of this child and its descendants detached from any parent or document.
public Content

Returns:

this child detached
detach
()

Detaches 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.
equals
(Object
Object to compare to.
ob
)

Overrides java.lang.Object.equals.

This tests for equality of this Content object to the supplied object.
public Document

Returns:

this child's owning document or null if none
getDocument
()

Return this child's owning document or null if the branch containing this child is currently not attached to a document.

public Parent

Returns:

this child's parent or null if none
getParent
()

Return this child's parent, or null if this child is currently not attached.

public Element

Returns:

the containing Element or null if unattached or a root 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.

public abstract String

Returns:

xpath string value of this child.
getValue
()

Returns the XPath 1.0 string value of this child.

public final int

Returns:

int - hash code.
hashCode
()

Overrides java.lang.Object.hashCode.

This returns the hash code for this Content item.
protected Content

Returns:

the target element
setParent
(Parent
new parent element
parent
)

Sets the parent of this Content.

Inherited from java.lang.Object:
finalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

parentback to summary
protected Parent parent

Constructor Detail

Contentback to summary
protected Content()

Method Detail

cloneback to summary
public Object clone()

Overrides java.lang.Object.clone.

Returns a deep, unattached copy of this child and its descendants detached from any parent or document.

Returns:Object

a detached deep copy of this child and descendants

detachback to summary
public Content detach()

Detaches this child from its parent or does nothing if the child has no parent.

Returns:Content

this child detached

equalsback to summary
public final boolean equals(Object ob)

Overrides java.lang.Object.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.

Parameters
ob:Object

Object to compare to.

Returns:boolean

boolean - whether the Content is equal to the supplied Object.

getDocumentback 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.

Returns:Document

this child's owning document or null if none

getParentback 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 Element or a Document.

Returns:Parent

this child's parent or null if none

getParentElementback to summary
public 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.

Returns:Element

the containing Element or null if unattached or a root element

getValueback to summary
public abstract String getValue()

Returns the XPath 1.0 string value of this child.

Returns:String

xpath string value of this child.

hashCodeback to summary
public final int hashCode()

Overrides java.lang.Object.hashCode.

This returns the hash code for this Content item.

Returns:int

int - hash code.

setParentback to summary
protected Content setParent(Parent parent)

Sets the parent of this Content. The caller is responsible for removing any pre-existing parentage.

Parameters
parent:Parent

new parent element

Returns:Content

the target element