public interface IXMLElement extends Serializable
| Modifier and Type | Field and Description |
|---|---|
static int |
NO_LINE
No line number defined.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(IXMLElement child)
Adds a child element.
|
Enumeration<String> |
enumerateAttributeNames()
Returns an enumeration of all attribute names.
|
String |
getAttribute(String name)
Returns the value of an attribute.
|
String |
getAttribute(String name,
String defaultValue)
Returns the value of an attribute.
|
Properties |
getAttributes()
Returns all attributes as a Properties object.
|
IXMLElement |
getChildAtIndex(int index)
Returns the child at a specific index.
|
List<IXMLElement> |
getChildren()
Returns a list containing all the child elements.
|
int |
getChildrenCount()
Returns the number of children.
|
List<IXMLElement> |
getChildrenNamed(String name)
Returns a list of all child elements named name.
|
String |
getContent()
Return the #PCDATA content of the element.
|
Node |
getElement()
Get the embeded node of the XmlElement
|
IXMLElement |
getFirstChildNamed(String name)
Searches a child element.
|
int |
getLineNr()
Returns the line number in the data where the element started.
|
String |
getName()
Returns the name of the element.
|
boolean |
hasAttribute(String name)
Returns whether an attribute exists.
|
boolean |
hasChildren()
Returns whether the element has children.
|
void |
removeAttribute(String name)
Removes an attribute.
|
void |
removeChild(IXMLElement child)
Removes a child element.
|
void |
setAttribute(String name,
String value)
Sets an attribute.
|
void |
setContent(String content)
Sets the #PCDATA content.
|
static final int NO_LINE
String getName()
void addChild(IXMLElement child)
child - the non-null child to add.void removeChild(IXMLElement child)
child - the non-null child to remove.boolean hasChildren()
int getChildrenCount()
List<IXMLElement> getChildren()
IXMLElement getChildAtIndex(int index) throws ArrayIndexOutOfBoundsException
index - Index of the childArrayIndexOutOfBoundsException - if the index is out of bounds.IXMLElement getFirstChildNamed(String name)
name - the name of the child to search for.List<IXMLElement> getChildrenNamed(String name)
name - the name of the children to search for.String getAttribute(String name)
name - the non-null name of the attribute.String getAttribute(String name, String defaultValue)
name - the non-null name of the attribute.defaultValue - the default value of the attribute.void setAttribute(String name, String value)
name - the non-null name of the attribute.value - the non-null value of the attribute.void removeAttribute(String name)
name - the non-null name of the attribute.Enumeration<String> enumerateAttributeNames()
boolean hasAttribute(String name)
name - The name of the attributeProperties getAttributes()
int getLineNr()
NO_LINEString getContent()
void setContent(String content)
content - the (possibly null) content.Node getElement()
Copyright © 2001–2025. All rights reserved.