Inheritance diagram for org::jdom::Element:
Jason Hunter
Lucas Gonze
Kevin Regan
Dan Schaffer
Yusuf Goolamabbas
Kent C. Johnson
Jools Enticknap
Alex Rosen
Bradley S. Huffman
|
This protected constructor is provided in order to support an Element subclass that wants full control over variable initialization. It intentionally leaves all instance variables null, allowing a lightweight subclass implementation. The subclass is responsible for ensuring all the get and set methods on Element behave as documented. When implementing an Element subclass which doesn't require full control over variable initialization, be aware that simply calling super() (or letting the compiler add the implicit super() call) will not initialize the instance variables which will cause many of the methods to throw a NullPointerException. Therefore, the constructor for these subclasses should call one of the public constructors so variable initialization is handled automatically. |
|
Creates a new element with the supplied (local) name and namespace. If the provided namespace is null, the element will have no namespace.
|
|
Create a new element with the supplied (local) name and no namespace.
|
|
Creates a new element with the supplied (local) name and a namespace given by a URI. The element will be put into the unprefixed (default) namespace.
|
|
Creates a new element with the supplied (local) name and a namespace given by the supplied prefix and URI combination.
|
|
Inserts the content in a collection into the content list at the given index. In event of an exception the original content will be unchanged and the objects in the supplied collection will be unaltered.
|
|
Inserts the child into the content list at the given index.
|
|
Appends all children in the given collection to the end of the content list. In event of an exception during add the original content will be unchanged and the objects in the supplied collection will be unaltered.
|
|
Appends the child to the end of the element's content list.
|
|
This adds text content to this element. It does not replace the existing content as does
|
|
Adds a namespace declarations to this element. This should not be used to add the declaration for this element itself; that should be assigned in the construction of the element. Instead, this is for adding namespace declarations on the element not relating directly to itself. It's used during output to for stylistic reasons move namespace declarations higher in the tree than they would have to be.
|
|
This returns a deep clone of this element. The new element is detached from its parent, and getParent() on the clone will return null.
Reimplemented from org::jdom::Content. |
|
Returns a list containing detached clones of this parent's content list.
Implements org::jdom::Parent. |
|
Returns a list of the additional namespace declarations on this element. This includes only additional namespace, not the namespace of the element itself, which can be obtained through getNamespace(). If there are no additional declarations, this returns an empty list. Note, the returned list is unmodifiable.
|
|
This returns the attribute for this element with the given name and within the given Namespace, or null if no such attribute exists.
|
|
This returns the attribute for this element with the given name and within no namespace, or null if no such attribute exists.
|
|
This returns the complete set of attributes for this element, as a
|
|
This returns the attribute value for the attribute with the given name and within the given Namespace, or the passed-in default if there is no such attribute.
|
|
This returns the attribute value for the attribute with the given name and within the given Namespace, null if there is no such attribute, and the empty string if the attribute value is empty.
|
|
This returns the attribute value for the attribute with the given name and within no namespace, or the passed-in default if there is no such attribute.
|
|
This returns the attribute value for the attribute with the given name and within no namespace, null if there is no such attribute, and the empty string if the attribute value is empty.
|
|
This returns the first child element within this element with the given local name and belonging to no namespace. If no elements exist for the specified name and namespace, null is returned.
|
|
This returns the first child element within this element with the given local name and belonging to the given namespace. If no elements exist for the specified name and namespace, null is returned.
|
|
This returns a
Please see the notes for
|
|
This returns a
Please see the notes for
|
|
This returns a Sequential traversal through the List is best done with a Iterator since the underlying implement of List.size() may not be the most efficient. No recursion is performed, so elements nested two levels deep would have to be obtained with:
|
|
Returns the textual content of the named child element, or null if there's no such child.
|
|
Returns the textual content of the named child element, or null if there's no such child. This method is a convenience because calling
|
|
Returns the normalized textual content of the named child element, or null if there's no such child.
|
|
Returns the normalized textual content of the named child element, or null if there's no such child. See
|
|
Returns the trimmed textual content of the named child element, or null if there's no such child.
|
|
Returns the trimmed textual content of the named child element, or null if there's no such child. See
|
|
Returns the child at the given index.
Implements org::jdom::Parent. |
|
Return a filter view of this Sequential traversal through the List is best done with a Iterator since the underlying implement of List.size() may require walking the entire list.
Implements org::jdom::Parent. |
|
This returns the full content of the element as a List which may contain objects of type Sequential traversal through the List is best done with an Iterator since the underlying implement of List.size() may require walking the entire list.
Implements org::jdom::Parent. |
|
Returns the number of children in this parent's content list. Children may be any Content type.
Implements org::jdom::Parent. |
|
Returns an iterator that walks over all descendants in document order applying the Filter to return only elements that match the filter rule. With filters you can match only Elements, only Comments, Elements or Comments, only Elements with a given name and/or prefix, and so on.
Implements org::jdom::Parent. |
|
Returns an iterator that walks over all descendants in document order.
Implements org::jdom::Parent. |
|
Returns the (local) name of the element (without any namespace prefix).
|
|
Returns the Namespace corresponding to the given prefix in scope for this element. This involves searching up the tree, so the results depend on the current location of the element. Returns null if there is no namespace in scope with the given prefix at this point in the document.
|
|
Returns the element's Namespace.
|
|
Returns the namespace prefix of the element or an empty string if none exists.
|
|
Returns the namespace URI mapped to this element's prefix (or the in-scope default namespace URI if no prefix). If no mapping is found, an empty string is returned.
|
|
Returns the full name of the element, in the form [namespacePrefix]:[localName]. If the element does not have a namespace prefix, then the local name is returned.
|
|
Returns the textual content directly held under this element as a string. This includes all text within this single element, including whitespace and CDATA sections if they exist. It's essentially the concatenation of all Text and CDATA nodes returned by getContent. The call does not recurse into child elements. If no textual value exists for the element, an empty string is returned.
|
|
Returns the textual content of this element with all surrounding whitespace removed and internal whitespace normalized to a single space. If no textual value exists for the element, or if only whitespace exists, the empty string is returned.
|
|
Returns the textual content of this element with all surrounding whitespace removed. If no textual value exists for the element, or if only whitespace exists, the empty string is returned.
|
|
Returns the XPath 1.0 string value of this element, which is the complete, ordered content of all text node descendants of this element (i.e. the text that's left after all references are resolved and all other markup is stripped out.)
Implements org::jdom::Content. |
|
Returns the index of the supplied child in the content list, or -1 if not a child of this parent.
Implements org::jdom::Parent. |
|
Determines if this element is the ancestor of another element.
|
|
Returns whether this element is a root element. This can be used in tandem with getParent to determine if an element has any "attachments" to a parent element or document.
|
|
This removes the supplied Attribute should it exist.
|
|
This removes the attribute with the given name and within the given Namespace. If no such attribute exists, this method does nothing.
|
|
This removes the attribute with the given name and within no namespace. If no such attribute exists, this method does nothing.
|
|
This removes the first child element (one level deep) with the given local name and belonging to the given namespace. Returns true if a child was removed.
|
|
This removes the first child element (one level deep) with the given local name and belonging to no namespace. Returns true if a child was removed.
|
|
This removes all child elements (one level deep) with the given local name and belonging to the given namespace. Returns true if any were removed.
|
|
This removes all child elements (one level deep) with the given local name and belonging to no namespace. Returns true if any were removed.
|
|
Removes and returns the child at the given index, or returns null if there's no such child.
Implements org::jdom::Parent. |
|
Removes a single child node from the content list.
Implements org::jdom::Parent. |
|
Remove all child content from this parent matching the supplied filter.
Implements org::jdom::Parent. |
|
Removes all child content from this parent.
Implements org::jdom::Parent. |
|
Removes an additional namespace declarations from this element. This should not be used to remove the declaration for this element itself; that should be handled in the construction of the element. Instead, this is for removing namespace declarations on the element not relating directly to itself. If the declaration is not present, this method does nothing.
|
|
This sets an attribute value for this element. Any existing attribute with the same name and namespace URI is removed.
|
|
This sets an attribute value for this element. Any existing attribute with the same name and namespace URI is removed.
|
|
This sets an attribute value for this element. Any existing attribute with the same name and namespace URI is removed.
|
|
This sets the attributes of the element. The supplied List should contain only objects of type When all objects in the supplied List are legal and before the new attributes are added, all old attributes will have their parentage set to null (no parent) and the old attribute list will be cleared. This has the effect that any active attribute list (previously obtained with a call to getAttributes) will also change to reflect the new attributes. In addition, all attributes in the supplied List will have their parentage set to this element, but the List itself will not be "live" and further removals and additions will have no effect on this elements attributes. If the user wants to continue working with a "live" attribute list, then a call to setAttributes should be followed by a call to getAttributes to obtain a "live" version of the attributes. Passing a null or empty List clears the existing attributes. In cases where the List contains duplicate attributes, only the last one will be retained. This has the same effect as calling setAttribute(Attribute) sequentially. In event of an exception the original attributes will be unchanged and the attributes in the supplied attributes will be unaltered.
|
|
Set this element's content to be the supplied child. If the supplied child is legal content for this parent and before it is added, all content in the current content list will be cleared and all current children will have their parentage set to null. This has the effect that any active list (previously obtained with a call to one of the getContent methods will also change to reflect the new content. In addition, all content in the supplied collection will have their parentage set to this parent. If the user wants to continue working with a "live" list of this parent's child, then a call to setContent should be followed by a call to one of the getContent methods to obtain a "live" version of the children. Passing a null child clears the existing content. In event of an exception the original content will be unchanged and the supplied child will be unaltered.
|
|
Replace the child at the given index whith the supplied collection. In event of an exception the original content will be unchanged and the content in the supplied collection will be unaltered.
|
|
Replace the current child the given index with the supplied child. In event of an exception the original content will be unchanged and the supplied child will be unaltered.
|
|
This sets the content of the element. The supplied List should contain only objects of type When all objects in the supplied List are legal and before the new content is added, all objects in the old content will have their parentage set to null (no parent) and the old content list will be cleared. This has the effect that any active list (previously obtained with a call to getContent or getChildren) will also change to reflect the new content. In addition, all objects in the supplied List will have their parentage set to this element, but the List itself will not be "live" and further removals and additions will have no effect on this elements content. If the user wants to continue working with a "live" list, then a call to setContent should be followed by a call to getContent or getChildren to obtain a "live" version of the content. Passing a null or empty List clears the existing content. In event of an exception the original content will be unchanged and the objects in the supplied content will be unaltered.
|
|
Sets the (local) name of the element.
|
|
Sets the element's Namespace. If the provided namespace is null, the element will have no namespace.
|
|
Sets the content of the element to be the text given. All existing text content and non-text context is removed. If this element should have both textual content and nested elements, use
|
|
This returns a
|
|
Additional namespace declarations to store on this element; useful during output |
|
The attributes of the element. Subclassers have to track attributes using their own mechanism. |
|
The content of the element. Subclassers have to track content using their own mechanism. |
|
The local name of the element |