public class XmlElement extends Object
修飾子とタイプ | クラスと説明 |
---|---|
static interface |
XmlElement.EnumlateCallback |
コンストラクタと説明 |
---|
XmlElement() |
修飾子とタイプ | メソッドと説明 |
---|---|
String |
childAttributeToString(String tag,
String attribute)
指定子要素の指定属性を取得する
失敗したらnullを返す
|
double |
childToDouble(String tag,
double def)
子要素の持つコンテンツを実数として取得する
|
int |
childToInt(String tag,
int def)
子要素の持つコンテンツを整数として取得する
|
String |
childToString(String tag)
子要素の持つコンテンツを文字列として取得する
|
String |
getAttribute(String key)
サブコンテンツを取得する
|
XmlElement |
getChild(String tag)
指定した子要素を取得する。
|
String |
getContent()
メインコンテンツを取得する
|
String |
getNamespace()
ネームスペースを取得する
|
XmlElement |
getParent()
親属性を取得する
|
String |
getTag()
XMLタグを取得する
|
List<XmlElement> |
listChilds(String tag)
一致するタグの子エレメントを列挙する
|
void |
listChilds(String tag,
XmlElement.EnumlateCallback callback)
指定した名前の子要素を列挙してコールバックする
|
static XmlElement |
parse(InputStream is) |
static XmlElement |
parse(String xml) |
public String getTag()
public String getContent()
public String getNamespace()
public int childToInt(String tag, int def)
tag
- def
- public double childToDouble(String tag, double def)
tag
- def
- public String childAttributeToString(String tag, String attribute)
tag
- attribute
- public List<XmlElement> listChilds(String tag)
tag
- public void listChilds(String tag, XmlElement.EnumlateCallback callback)
tag
- callback
- public XmlElement getChild(String tag)
tag
- public XmlElement getParent()
public static XmlElement parse(InputStream is) throws org.xmlpull.v1.XmlPullParserException, IOException
org.xmlpull.v1.XmlPullParserException
IOException
public static XmlElement parse(String xml) throws org.xmlpull.v1.XmlPullParserException, IOException
org.xmlpull.v1.XmlPullParserException
IOException