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