FileDocCategorySizeDatePackage
ExpatAttributes.javaAPI DocAndroid 1.5 API4689Wed May 06 22:41:06 BST 2009org.apache.harmony.xml

ExpatAttributes

public abstract class ExpatAttributes extends Object implements Attributes
Wraps native attribute array.

Fields Summary
private static final String
CDATA
Since we don't do validation, pretty much everything is CDATA type.
Constructors Summary
Methods Summary
static native voidfreeAttributes(int pointer)

public intgetIndex(java.lang.String qName)

        if (qName == null) {
            throw new NullPointerException("uri");
        }
        int pointer = getPointer();
        if (pointer == 0) {
            return -1;
        }
        return getIndex(pointer, qName);
    
static native intgetIndex(int attributePointer, java.lang.String uri, java.lang.String localName)

static native intgetIndex(int attributePointer, java.lang.String qName)

public intgetIndex(java.lang.String uri, java.lang.String localName)

        if (uri == null) {
            throw new NullPointerException("uri");
        }
        if (localName == null) {
            throw new NullPointerException("local name");
        }
        int pointer = getPointer();
        if (pointer == 0) {
            return -1;
        }
        return getIndex(pointer, uri, localName);
    
public abstract intgetLength()
Gets the number of attributes.

static native java.lang.StringgetLocalName(int pointer, int attributePointer, int index)

public java.lang.StringgetLocalName(int index)

        return (index < 0 || index >= getLength())
                ? null
                : getLocalName(getParserPointer(), getPointer(), index);
    
abstract intgetParserPointer()
Gets the pointer to the parser. We need this so we can get to the interned string pool.

public abstract intgetPointer()
Gets the pointer to the underlying attribute array. Can be 0 if the length is 0.

static native java.lang.StringgetQName(int pointer, int attributePointer, int index)

public java.lang.StringgetQName(int index)

        return (index < 0 || index >= getLength())
                ? null
                : getQName(getParserPointer(), getPointer(), index);
    
public java.lang.StringgetType(java.lang.String uri, java.lang.String localName)

        if (uri == null) {
            throw new NullPointerException("uri");
        }
        if (localName == null) {
            throw new NullPointerException("local name");
        }
        return getIndex(uri, localName) == -1 ? null : CDATA;
    
public java.lang.StringgetType(java.lang.String qName)

        return getIndex(qName) == -1 ? null : CDATA;
    
public java.lang.StringgetType(int index)

        return (index < 0 || index >= getLength()) ? null : CDATA;
    
static native java.lang.StringgetURI(int pointer, int attributePointer, int index)

public java.lang.StringgetURI(int index)


              
       

                           
      

                         
       

        
        if (index < 0 || index >= getLength()) {
            return null;
        }
        return getURI(getParserPointer(), getPointer(), index);
    
public java.lang.StringgetValue(java.lang.String uri, java.lang.String localName)

        if (uri == null) {
            throw new NullPointerException("uri");
        }
        if (localName == null) {
            throw new NullPointerException("local name");
        }
        int pointer = getPointer();
        if (pointer == 0) {
            return null;
        }
        return getValue(pointer, uri, localName);
    
public java.lang.StringgetValue(java.lang.String qName)

        if (qName == null) {
            throw new NullPointerException("qName");
        }
        int pointer = getPointer();
        if (pointer == 0) {
            return null;
        }
        return getValue(pointer, qName);
    
static native java.lang.StringgetValue(int attributePointer, int index)

static native java.lang.StringgetValue(int attributePointer, java.lang.String uri, java.lang.String localName)

static native java.lang.StringgetValue(int attributePointer, java.lang.String qName)

public java.lang.StringgetValue(int index)

        return (index < 0 || index >= getLength())
                ? null
                : getValue(getPointer(), index);