FileDocCategorySizeDatePackage
XmlPullAttributes.javaAPI DocAndroid 5.1 API4672Thu Mar 12 22:22:10 GMT 2015android.util

XmlPullAttributes

public class XmlPullAttributes extends Object implements android.util.AttributeSet
Provides an implementation of AttributeSet on top of an XmlPullParser.

Fields Summary
XmlPullParser
mParser
Constructors Summary
public XmlPullAttributes(XmlPullParser parser)

        mParser = parser;
    
Methods Summary
public booleangetAttributeBooleanValue(int index, boolean defaultValue)

        return XmlUtils.convertValueToBoolean(
            getAttributeValue(index), defaultValue);
    
public booleangetAttributeBooleanValue(java.lang.String namespace, java.lang.String attribute, boolean defaultValue)

        return XmlUtils.convertValueToBoolean(
            getAttributeValue(namespace, attribute), defaultValue);
    
public intgetAttributeCount()

        return mParser.getAttributeCount();
    
public floatgetAttributeFloatValue(java.lang.String namespace, java.lang.String attribute, float defaultValue)

        String s = getAttributeValue(namespace, attribute);
        if (s != null) {
            return Float.parseFloat(s);
        }
        return defaultValue;
    
public floatgetAttributeFloatValue(int index, float defaultValue)

        String s = getAttributeValue(index);
        if (s != null) {
            return Float.parseFloat(s);
        }
        return defaultValue;
    
public intgetAttributeIntValue(java.lang.String namespace, java.lang.String attribute, int defaultValue)

        return XmlUtils.convertValueToInt(
            getAttributeValue(namespace, attribute), defaultValue);
    
public intgetAttributeIntValue(int index, int defaultValue)

        return XmlUtils.convertValueToInt(
            getAttributeValue(index), defaultValue);
    
public intgetAttributeListValue(int index, java.lang.String[] options, int defaultValue)

        return XmlUtils.convertValueToList(
            getAttributeValue(index), options, defaultValue);
    
public intgetAttributeListValue(java.lang.String namespace, java.lang.String attribute, java.lang.String[] options, int defaultValue)

        return XmlUtils.convertValueToList(
            getAttributeValue(namespace, attribute), options, defaultValue);
    
public java.lang.StringgetAttributeName(int index)

        return mParser.getAttributeName(index);
    
public intgetAttributeNameResource(int index)

        return 0;
    
public intgetAttributeResourceValue(java.lang.String namespace, java.lang.String attribute, int defaultValue)

        return XmlUtils.convertValueToInt(
            getAttributeValue(namespace, attribute), defaultValue);
    
public intgetAttributeResourceValue(int index, int defaultValue)

        return XmlUtils.convertValueToInt(
            getAttributeValue(index), defaultValue);
    
public intgetAttributeUnsignedIntValue(java.lang.String namespace, java.lang.String attribute, int defaultValue)

        return XmlUtils.convertValueToUnsignedInt(
            getAttributeValue(namespace, attribute), defaultValue);
    
public intgetAttributeUnsignedIntValue(int index, int defaultValue)

        return XmlUtils.convertValueToUnsignedInt(
            getAttributeValue(index), defaultValue);
    
public java.lang.StringgetAttributeValue(int index)

        return mParser.getAttributeValue(index);
    
public java.lang.StringgetAttributeValue(java.lang.String namespace, java.lang.String name)

        return mParser.getAttributeValue(namespace, name);
    
public java.lang.StringgetClassAttribute()

        return getAttributeValue(null, "class");
    
public java.lang.StringgetIdAttribute()

        return getAttributeValue(null, "id");
    
public intgetIdAttributeResourceValue(int defaultValue)

        return getAttributeResourceValue(null, "id", defaultValue);
    
public java.lang.StringgetPositionDescription()

        return mParser.getPositionDescription();
    
public intgetStyleAttribute()

        return getAttributeResourceValue(null, "style", 0);