public String getURI(int index) { if (index < 0 || index >= mAttrCount) { throwIndex(index); } return mAttributes[index].mNamespaceURI; }
public String getNsURI(int index) { if (index < 0 || index >= mNsCount) { throwIndex(index); } return mNamespaces[index].mNamespaceURI; }
public String getNsPrefix(int index) { if (index < 0 || index >= mNsCount) { throwIndex(index); } // for NS decls, local name is stored in prefix return mNamespaces[index].mLocalName; }
public String getPrefix(int index) { if (index < 0 || index >= mAttrCount) { throwIndex(index); } return mAttributes[index].mPrefix; }
public String getLocalName(int index) { if (index < 0 || index >= mAttrCount) { throwIndex(index); } return mAttributes[index].mLocalName; }
public QName getQName(int index) { if (index < 0 || index >= mAttrCount) { throwIndex(index); } return mAttributes[index].getQName(); }
/** * Method called to decode the attribute value that consists of * zero or more space-separated tokens. * Decoding is done using the decoder provided. * @return Number of tokens decoded */ public final int decodeValues(int index, TypedArrayDecoder tad, InputProblemReporter rep) throws XMLStreamException { if (index < 0 || index >= mAttrCount) { throwIndex(index); } // Char[] faster than String... and no need to trim here: return decodeValues(tad, rep, mValueBuilder.getCharBuffer(), mAttributes[index].mValueStartOffset, getValueStartOffset(index+1)); }
/** *<p> * Note: the main reason this method is defined at this level, and * made final, is performance. JIT may be able to fully inline this * method, even when reference is via this base class. This is important * since this is likely to be the most often called method of the * collector instances. */ public final String getValue(int index) { if (index < 0 || index >= mAttrCount) { throwIndex(index); } String full = mValueBuilder.getAllValues(); Attribute attr = mAttributes[index]; ++index; if (index < mAttrCount) { // not last int endOffset = mAttributes[index].mValueStartOffset; return attr.getValue(full, endOffset); } // last can be optimized bit more: return attr.getValue(full); }
public final byte[] decodeBinary(int index, Base64Variant v, CharArrayBase64Decoder dec, InputProblemReporter rep) throws XMLStreamException { if (index < 0 || index >= mAttrCount) { throwIndex(index); } /* No point in trying to use String representation, even if one * available, faster to process from char[] */ Attribute attr = mAttributes[index]; char[] cbuf = mValueBuilder.getCharBuffer(); int start = attr.mValueStartOffset; int end = getValueStartOffset(index+1); int len = end-start; dec.init(v, true, cbuf, start, len, null); try { return dec.decodeCompletely(); } catch (IllegalArgumentException iae) { // Need to convert to a checked stream exception String lexical = new String(cbuf, start, len); throw new TypedXMLStreamException(lexical, iae.getMessage(), rep.getLocation(), iae); } }
public String getPrefix(int index) { if (index < 0 || index >= mAttrCount) { throwIndex(index); } return mAttributes[index].mPrefix; }
public String getNsPrefix(int index) { if (index < 0 || index >= mNsCount) { throwIndex(index); } // for NS decls, local name is stored in prefix return mNamespaces[index].mLocalName; }
public String getLocalName(int index) { if (index < 0 || index >= mAttrCount) { throwIndex(index); } return mAttributes[index].mLocalName; }
public String getPrefix(int index) { if (index < 0 || index >= mAttrCount) { throwIndex(index); } return mAttributes[index].mPrefix; }
public String getNsPrefix(int index) { if (index < 0 || index >= mNsCount) { throwIndex(index); } // for NS decls, local name is stored in prefix return mNamespaces[index].mLocalName; }
public String getLocalName(int index) { if (index < 0 || index >= mAttrCount) { throwIndex(index); } return mAttributes[index].mLocalName; }
public String getNsURI(int index) { if (index < 0 || index >= mNsCount) { throwIndex(index); } return mNamespaces[index].mNamespaceURI; }
public String getURI(int index) { if (index < 0 || index >= mAttrCount) { throwIndex(index); } return mAttributes[index].mNamespaceURI; }
public String getNsURI(int index) { if (index < 0 || index >= mNsCount) { throwIndex(index); } return mNamespaces[index].mNamespaceURI; }
public QName getQName(int index) { if (index < 0 || index >= mAttrCount) { throwIndex(index); } return mAttributes[index].getQName(); }