T - Class extending Element@ConsumerType
public abstract class AbstractElement<T extends AbstractElement>
extends org.jdom2.Element
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractElement(String name)
Initializes DOM element.
|
| Modifier and Type | Method and Description |
|---|---|
<ElementType extends AbstractElement> |
add(ElementType element)
Appends the child to the end of the element's content list.
|
org.jdom2.Element |
addContent(Collection collection)
Appends all children in the given collection to the end of the content list.
|
org.jdom2.Element |
addContent(org.jdom2.Content content)
Appends the child to the end of the element's content list
|
org.jdom2.Element |
addContent(int index,
Collection collection)
Inserts the content in a collection into the content list at the given index.
|
org.jdom2.Element |
addContent(int index,
org.jdom2.Content content)
Inserts the child into the content list at the given index
|
org.jdom2.Element |
addContent(String text)
This adds text content to this element.
|
int |
getAttributeValueAsInteger(String attributeName)
Gets attribute value as integer.
|
long |
getAttributeValueAsLong(String attributeName)
Gets attribute value as long.
|
org.jdom2.Element |
setAttribute(String name,
String value)
This sets an attribute value for this element.
|
org.jdom2.Element |
setAttribute(String name,
String value,
org.jdom2.Namespace ns)
This sets an attribute value for this element.
|
T |
setAttributeValueAsInteger(String name,
int value)
Sets attribute value as integer.
|
T |
setAttributeValueAsLong(String name,
long value)
Sets attribute value as long.
|
org.jdom2.Element |
setName(String value)
Deprecated.
Deprecated
|
org.jdom2.Element |
setText(String text)
Sets the content of the element to be the text given.
|
String |
toString() |
String |
toStringContentOnly() |
addNamespaceDeclaration, canContainContent, clone, cloneContent, coalesceText, detach, getAdditionalNamespaces, getAttribute, getAttribute, getAttributes, getAttributeValue, getAttributeValue, getAttributeValue, getAttributeValue, getChild, getChild, getChildren, getChildren, getChildren, getChildText, getChildText, getChildTextNormalize, getChildTextNormalize, getChildTextTrim, getChildTextTrim, getContent, getContent, getContent, getContentSize, getDescendants, getDescendants, getName, getNamespace, getNamespace, getNamespacePrefix, getNamespacesInherited, getNamespacesInScope, getNamespacesIntroduced, getNamespaceURI, getQualifiedName, getText, getTextNormalize, getTextTrim, getValue, getXMLBaseURI, hasAdditionalNamespaces, hasAttributes, indexOf, isAncestor, isRootElement, removeAttribute, removeAttribute, removeAttribute, removeChild, removeChild, removeChildren, removeChildren, removeContent, removeContent, removeContent, removeContent, removeNamespaceDeclaration, setAttribute, setAttributes, setContent, setContent, setContent, setContent, setNamespace, sortAttributes, sortChildren, sortContent, sortContentequals, getCType, getDocument, getParent, getParentElement, hashCode, setParentprotected AbstractElement(String name)
name - Element name@Deprecated public final org.jdom2.Element setName(String value)
setName in class org.jdom2.Elementvalue - Element namepublic final int getAttributeValueAsInteger(String attributeName)
attributeName - Attribute namepublic final T setAttributeValueAsLong(String name, long value)
name - Attribute namevalue - Attribute value as longpublic final long getAttributeValueAsLong(String attributeName)
attributeName - Attribute namepublic final T setAttributeValueAsInteger(String name, int value)
name - Attribute namevalue - Attribute value as integerpublic final org.jdom2.Element addContent(org.jdom2.Content content)
addContent in interface org.jdom2.ParentaddContent in class org.jdom2.Elementcontent - Child to append to end of content list. Null values are ignored.public final org.jdom2.Element addContent(int index,
org.jdom2.Content content)
addContent in interface org.jdom2.ParentaddContent in class org.jdom2.Elementindex - Location for adding the collectioncontent - Child to append to end of content list. Null values are ignored.public final org.jdom2.Element addContent(String text)
addContent in class org.jdom2.Elementtext - String to add. Null values are ignored.public final org.jdom2.Element addContent(Collection collection)
addContent in interface org.jdom2.ParentaddContent in class org.jdom2.Elementcollection - Collection to append. Null values are ignored.public final org.jdom2.Element addContent(int index,
Collection collection)
addContent in interface org.jdom2.ParentaddContent in class org.jdom2.Elementindex - Location for adding the collectioncollection - Collection to insert. Null values are ignored.public final <ElementType extends AbstractElement> ElementType add(ElementType element)
ElementType - Type that extends Elementelement - Element to add. Null values are ignored.public org.jdom2.Element setText(String text)
Element.setContent(java.util.Collection<? extends org.jdom2.Content>) instead.
Setting a null text value is equivalent to setting an empty string value.setText in class org.jdom2.Elementtext - new text content for the elementorg.jdom2.IllegalDataException - if the assigned text contains an illegal character such as a
vertical tab (as determined by Verifier.checkCharacterData(java.lang.String))public final org.jdom2.Element setAttribute(String name, String value, org.jdom2.Namespace ns)
This sets an attribute value for this element. Any existing attribute with the same name and namespace URI is removed.
setAttribute in class org.jdom2.Elementname - name of the attribute to setvalue - value of the attribute to setns - namespace of the attribute to setorg.jdom2.IllegalNameException - if the given name is illegal as an attribute name, or if the namespace
is an unprefixed default namespaceorg.jdom2.IllegalDataException - if the given attribute value is illegal character data (as determined
by Verifier.checkCharacterData(java.lang.String)).org.jdom2.IllegalAddException - if the attribute namespace prefix collides with another namespace
prefix on the element.public final org.jdom2.Element setAttribute(String name, String value)
This sets an attribute value for this element. Any existing attribute with the same name and namespace URI is removed.
setAttribute in class org.jdom2.Elementname - name of the attribute to setvalue - value of the attribute to setorg.jdom2.IllegalNameException - if the given name is illegal as an attribute name.org.jdom2.IllegalDataException - if the given attribute value is illegal character data
(as determined by Verifier.checkCharacterData(java.lang.String)).public String toString()
toString in class org.jdom2.Elementpublic String toStringContentOnly()
Copyright © 2014–2017 wcm.io. All rights reserved.