AttributeSet 的意义

[color=brown] /**
* Return an AttributeSet interface for use with the given XmlPullParser.
* If the given parser itself implements AttributeSet, that implementation
* is simply returned. Otherwise a wrapper class is
* instantiated on top of the XmlPullParser, as a proxy for retrieving its
* attributes, and returned to you.
*
* @param parser The existing parser for which you would like an
* AttributeSet.
*
* @return An AttributeSet you can use to retrieve the
* attribute values at each of the tags as the parser moves
* through its XML document.
*
* @see AttributeSet
*/[/color]
public static AttributeSet asAttributeSet(XmlPullParser parser) {
return (parser instanceof AttributeSet)
? (AttributeSet) parser
: new XmlPullAttributes(parser);
}

在google android源码 Xml.java 文件中

你可能感兴趣的:(AttributeSet 的意义)