Package de.pdark.decentxml
Class Element
- java.lang.Object
-
- de.pdark.decentxml.NodeWithChildren
-
- de.pdark.decentxml.Element
-
-
Field Summary
Fields Modifier and Type Field Description static NodeFilter<Element>
ELEMENT_FILTER
-
Method Summary
-
Methods inherited from class de.pdark.decentxml.NodeWithChildren
clearNodes, getNode, getNodes, getNodes, hasNodes, nodeCount, nodeIndexOf, removeNode, removeNode, toString, toXML
-
-
-
-
Field Detail
-
ELEMENT_FILTER
public static final NodeFilter<Element> ELEMENT_FILTER
-
-
Method Detail
-
getStartToken
public Token getStartToken()
-
getStartOffset
public int getStartOffset()
-
getEndOffset
public int getEndOffset()
-
getBeginName
public String getBeginName()
-
getEndName
public String getEndName()
-
setEndName
public Element setEndName(String endName)
The string to be put into the end tag. This can contain whitespace around the name
-
getPostSpace
public String getPostSpace()
Space before the closing bracket of the element
-
getName
public String getName()
-
getParent
public Parent getParent()
Description copied from interface:Child
The parent of this child
-
setParent
public Element setParent(Parent parent)
Description copied from interface:Child
Change the parent of this child.CAUTION: If the child is already attached to a parent, this call will not detach the old relation! You must call
child.getParent().removeNode (child)
, first!
-
addNode
public Element addNode(Node node)
- Specified by:
addNode
in interfaceParent
- Overrides:
addNode
in classNodeWithChildren
-
addNode
public Element addNode(int index, Node node)
- Specified by:
addNode
in interfaceParent
- Overrides:
addNode
in classNodeWithChildren
-
addNodes
public Element addNodes(Collection<? extends Node> nodes)
- Specified by:
addNodes
in interfaceParent
- Overrides:
addNodes
in classNodeWithChildren
-
addNodes
public Element addNodes(int index, Collection<? extends Node> nodes)
- Specified by:
addNodes
in interfaceParent
- Overrides:
addNodes
in classNodeWithChildren
-
addNodes
public Element addNodes(Node... nodes)
- Specified by:
addNodes
in interfaceParent
- Overrides:
addNodes
in classNodeWithChildren
-
addNodes
public Element addNodes(int index, Node... nodes)
- Specified by:
addNodes
in interfaceParent
- Overrides:
addNodes
in classNodeWithChildren
-
setCompactEmpty
public Element setCompactEmpty(boolean compactEmpty)
-
isCompactEmpty
public boolean isCompactEmpty()
-
toXML
public Element toXML(XMLWriter writer) throws IOException
Description copied from interface:Node
Fast way to convert many nodes to XML- Specified by:
toXML
in interfaceNode
- Overrides:
toXML
in classNodeWithChildren
- Throws:
IOException
-
getType
public XMLTokenizer.Type getType()
Description copied from interface:Node
Get the node type
-
getChild
public Element getChild(int index)
-
hasChildren
public boolean hasChildren()
-
clearChildNodes
public Element clearChildNodes()
Deprecated.Use Element.clearChildren() instead
-
clearChildren
public Element clearChildren()
-
getText
public String getText()
Description copied from interface:TextNode
Get the text from the node
-
getTrimmedText
public String getTrimmedText()
-
getNormalizedText
public String getNormalizedText()
-
setText
public Element setText(String text)
Description copied from interface:TextNode
Change the text of the node. When necessary, the text will be escaped before writing it to the output stream.
-
clearText
public Element clearText()
-
getParentElement
public Element getParentElement()
-
getNodePath
public String getNodePath()
Deprecated.Use Element.getChildPath() insteadDescription copied from interface:Child
Return a path which uniquely describes this child.- Specified by:
getNodePath
in interfaceChild
-
getChildPath
public String getChildPath()
-
childIndexOf
public int childIndexOf(Element element)
-
getDocument
public Document getDocument()
-
getChild
public Element getChild(String path)
Description copied from interface:Parent
Find a child element (not a node!) by path
-
createClone
public Element createClone()
Description copied from interface:Node
Simulate clone()- Specified by:
createClone
in interfaceNode
-
copy
public Element copy(Node orig)
Description copied from interface:Node
Copy all data fromorig
intothis
- Specified by:
copy
in interfaceNode
- Overrides:
copy
in classNodeWithChildren
-
copy
public Element copy()
Description copied from interface:Node
Simulate clone()- Specified by:
copy
in interfaceNode
- Overrides:
copy
in classNodeWithChildren
-
setNamespace
public void setNamespace(Namespace namespace)
-
getNamespace
public Namespace getNamespace()
-
-