public static class XmlReader.Element
extends java.lang.Object
Constructor and Description |
---|
XmlReader.Element(java.lang.String name,
XmlReader.Element parent) |
Modifier and Type | Method and Description |
---|---|
void |
addChild(XmlReader.Element element) |
java.lang.String |
get(java.lang.String name)
Returns the attribute value with the specified name, or if no attribute is found, the text of a child with the name.
|
java.lang.String |
get(java.lang.String name,
java.lang.String defaultValue)
Returns the attribute value with the specified name, or if no attribute is found, the text of a child with the name.
|
java.lang.String |
getAttribute(java.lang.String name) |
java.lang.String |
getAttribute(java.lang.String name,
java.lang.String defaultValue) |
ObjectMap<java.lang.String,java.lang.String> |
getAttributes() |
boolean |
getBoolean(java.lang.String name)
Returns the attribute value with the specified name, or if no attribute is found, the text of a child with the name.
|
boolean |
getBoolean(java.lang.String name,
boolean defaultValue)
Returns the attribute value with the specified name, or if no attribute is found, the text of a child with the name.
|
boolean |
getBooleanAttribute(java.lang.String name) |
boolean |
getBooleanAttribute(java.lang.String name,
boolean defaultValue) |
XmlReader.Element |
getChild(int i) |
XmlReader.Element |
getChildByName(java.lang.String name) |
XmlReader.Element |
getChildByNameRecursive(java.lang.String name) |
int |
getChildCount() |
Array<XmlReader.Element> |
getChildrenByName(java.lang.String name) |
Array<XmlReader.Element> |
getChildrenByNameRecursively(java.lang.String name) |
float |
getFloat(java.lang.String name)
Returns the attribute value with the specified name, or if no attribute is found, the text of a child with the name.
|
float |
getFloat(java.lang.String name,
float defaultValue)
Returns the attribute value with the specified name, or if no attribute is found, the text of a child with the name.
|
float |
getFloatAttribute(java.lang.String name) |
float |
getFloatAttribute(java.lang.String name,
float defaultValue) |
int |
getInt(java.lang.String name)
Returns the attribute value with the specified name, or if no attribute is found, the text of a child with the name.
|
int |
getInt(java.lang.String name,
int defaultValue)
Returns the attribute value with the specified name, or if no attribute is found, the text of a child with the name.
|
int |
getIntAttribute(java.lang.String name) |
int |
getIntAttribute(java.lang.String name,
int defaultValue) |
java.lang.String |
getName() |
XmlReader.Element |
getParent() |
java.lang.String |
getText() |
void |
remove() |
void |
removeChild(int index) |
void |
removeChild(XmlReader.Element child) |
void |
setAttribute(java.lang.String name,
java.lang.String value) |
void |
setText(java.lang.String text) |
java.lang.String |
toString() |
java.lang.String |
toString(java.lang.String indent) |
public XmlReader.Element(java.lang.String name, XmlReader.Element parent)
public java.lang.String getName()
public ObjectMap<java.lang.String,java.lang.String> getAttributes()
public java.lang.String getAttribute(java.lang.String name)
GdxRuntimeException
- if the attribute was not found.public java.lang.String getAttribute(java.lang.String name, java.lang.String defaultValue)
public void setAttribute(java.lang.String name, java.lang.String value)
public int getChildCount()
public XmlReader.Element getChild(int i)
GdxRuntimeException
- if the element has no children.public void addChild(XmlReader.Element element)
public java.lang.String getText()
public void setText(java.lang.String text)
public void removeChild(int index)
public void removeChild(XmlReader.Element child)
public void remove()
public XmlReader.Element getParent()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(java.lang.String indent)
public XmlReader.Element getChildByName(java.lang.String name)
name
- the name of the child XmlReader.Element
public XmlReader.Element getChildByNameRecursive(java.lang.String name)
name
- the name of the child XmlReader.Element
public Array<XmlReader.Element> getChildrenByName(java.lang.String name)
name
- the name of the childrenArray
public Array<XmlReader.Element> getChildrenByNameRecursively(java.lang.String name)
name
- the name of the childrenArray
public float getFloatAttribute(java.lang.String name)
GdxRuntimeException
- if the attribute was not found.public float getFloatAttribute(java.lang.String name, float defaultValue)
public int getIntAttribute(java.lang.String name)
GdxRuntimeException
- if the attribute was not found.public int getIntAttribute(java.lang.String name, int defaultValue)
public boolean getBooleanAttribute(java.lang.String name)
GdxRuntimeException
- if the attribute was not found.public boolean getBooleanAttribute(java.lang.String name, boolean defaultValue)
public java.lang.String get(java.lang.String name)
GdxRuntimeException
- if no attribute or child was not found.public java.lang.String get(java.lang.String name, java.lang.String defaultValue)
GdxRuntimeException
- if no attribute or child was not found.public int getInt(java.lang.String name)
GdxRuntimeException
- if no attribute or child was not found.public int getInt(java.lang.String name, int defaultValue)
GdxRuntimeException
- if no attribute or child was not found.public float getFloat(java.lang.String name)
GdxRuntimeException
- if no attribute or child was not found.public float getFloat(java.lang.String name, float defaultValue)
GdxRuntimeException
- if no attribute or child was not found.public boolean getBoolean(java.lang.String name)
GdxRuntimeException
- if no attribute or child was not found.public boolean getBoolean(java.lang.String name, boolean defaultValue)
GdxRuntimeException
- if no attribute or child was not found.