/** * Set the type of a specific attribute. * * @param index The index of the attribute (zero-based). * @param type The attribute's type. * @exception java.lang.ArrayIndexOutOfBoundsException When the * supplied index does not point to an attribute * in the list. */ public void setType (int index, String type) { if (index >= 0 && index < length) { data[index*5+3] = type; } else { badIndex(index); } }
/** * Add an attribute to the end of the list. * * <p>For the sake of speed, this method does no checking * to see if the attribute is already in the list: that is * the responsibility of the application.</p> * * @param uri The Namespace URI, or the empty string if * none is available or Namespace processing is not * being performed. * @param localName The local name, or the empty string if * Namespace processing is not being performed. * @param qName The qualified (prefixed) name, or the empty string * if qualified names are not available. * @param type The attribute type as a string. * @param value The attribute value. */ public void addAttribute (String uri, String localName, String qName, String type, String value) { ensureCapacity(length+1); data[length*5] = uri; data[length*5+1] = localName; data[length*5+2] = qName; data[length*5+3] = type; data[length*5+4] = value; length++; }
public int getAttributeIndex(String uri, String localname) { return currentAtts.getIndex(uri, localname); } public void consumeAttribute(int index) throws SAXException {
public void consumeAttribute(int index) throws SAXException { final String uri = currentAtts.getURI(index); final String local = currentAtts.getLocalName(index); final String qname = currentAtts.getQName(index); final String value = currentAtts.getValue(index); currentAtts.removeAttribute(index); currentHandler.enterAttribute(uri,local,qname); currentHandler.text(value); currentHandler.leaveAttribute(uri,local,qname); }
/** * Cleans up all the data structure so that the object can be reused later. * Normally, applications do not need to call this method directly, * * as the runtime resets itself after the endDocument method. */ public void reset() { attStack.clear(); currentAtts = null; currentHandler = null; indent=0; locator = null; namespaces.clear(); needIndent = true; redirect = null; redirectionDepth = 0; text = new StringBuffer(); // add a dummy attributes at the bottom as a "centinel." attStack.push(new AttributesImpl()); }
/** * Copy an entire Attributes object. * * <p>It may be more efficient to reuse an existing object * rather than constantly allocating new ones.</p> * * @param atts The attributes to copy. */ public void setAttributes (Attributes atts) { clear(); length = atts.getLength(); data = new String[length*5]; for (int i = 0; i < length; i++) { data[i*5] = atts.getURI(i); data[i*5+1] = atts.getLocalName(i); data[i*5+2] = atts.getQName(i); data[i*5+3] = atts.getType(i); data[i*5+4] = atts.getValue(i); } }
public void consumeAttribute(int index) throws SAXException { final String uri = currentAtts.getURI(index); final String local = currentAtts.getLocalName(index); final String qname = currentAtts.getQName(index); final String value = currentAtts.getValue(index); currentAtts.removeAttribute(index); currentHandler.enterAttribute(uri,local,qname); currentHandler.text(value); currentHandler.leaveAttribute(uri,local,qname); }
/** * Cleans up all the data structure so that the object can be reused later. * Normally, applications do not need to call this method directly, * * as the runtime resets itself after the endDocument method. */ public void reset() { attStack.clear(); currentAtts = null; currentHandler = null; indent=0; locator = null; namespaces.clear(); needIndent = true; redirect = null; redirectionDepth = 0; text = new StringBuffer(); // add a dummy attributes at the bottom as a "centinel." attStack.push(new AttributesImpl()); }
/** * Copy an entire Attributes object. * * <p>It may be more efficient to reuse an existing object * rather than constantly allocating new ones.</p> * * @param atts The attributes to copy. */ public void setAttributes (Attributes atts) { clear(); length = atts.getLength(); data = new String[length*5]; for (int i = 0; i < length; i++) { data[i*5] = atts.getURI(i); data[i*5+1] = atts.getLocalName(i); data[i*5+2] = atts.getQName(i); data[i*5+3] = atts.getType(i); data[i*5+4] = atts.getValue(i); } }
public void consumeAttribute(int index) throws SAXException { final String uri = currentAtts.getURI(index); final String local = currentAtts.getLocalName(index); final String qname = currentAtts.getQName(index); final String value = currentAtts.getValue(index); currentAtts.removeAttribute(index); currentHandler.enterAttribute(uri,local,qname); currentHandler.text(value); currentHandler.leaveAttribute(uri,local,qname); }
/** * Set the type of a specific attribute. * * @param index The index of the attribute (zero-based). * @param type The attribute's type. * @exception java.lang.ArrayIndexOutOfBoundsException When the * supplied index does not point to an attribute * in the list. */ public void setType (int index, String type) { if (index >= 0 && index < length) { data[index*5+3] = type; } else { badIndex(index); } }
/** * Cleans up all the data structure so that the object can be reused later. * Normally, applications do not need to call this method directly, * * as the runtime resets itself after the endDocument method. */ public void reset() { attStack.clear(); currentAtts = null; currentHandler = null; indent=0; locator = null; namespaces.clear(); needIndent = true; redirect = null; redirectionDepth = 0; text = new StringBuffer(); // add a dummy attributes at the bottom as a "centinel." attStack.push(new AttributesImpl()); }
public int getAttributeIndex(String uri, String localname) { return currentAtts.getIndex(uri, localname); } public void consumeAttribute(int index) throws SAXException {
/** * Copy an entire Attributes object. * * <p>It may be more efficient to reuse an existing object * rather than constantly allocating new ones.</p> * * @param atts The attributes to copy. */ public void setAttributes (Attributes atts) { clear(); length = atts.getLength(); data = new String[length*5]; for (int i = 0; i < length; i++) { data[i*5] = atts.getURI(i); data[i*5+1] = atts.getLocalName(i); data[i*5+2] = atts.getQName(i); data[i*5+3] = atts.getType(i); data[i*5+4] = atts.getValue(i); } }
/** * Add an attribute to the end of the list. * * <p>For the sake of speed, this method does no checking * to see if the attribute is already in the list: that is * the responsibility of the application.</p> * * @param uri The Namespace URI, or the empty string if * none is available or Namespace processing is not * being performed. * @param localName The local name, or the empty string if * Namespace processing is not being performed. * @param qName The qualified (prefixed) name, or the empty string * if qualified names are not available. * @param type The attribute type as a string. * @param value The attribute value. */ public void addAttribute (String uri, String localName, String qName, String type, String value) { ensureCapacity(length+1); data[length*5] = uri; data[length*5+1] = localName; data[length*5+2] = qName; data[length*5+3] = type; data[length*5+4] = value; length++; }
public void consumeAttribute(int index) throws SAXException { final String uri = currentAtts.getURI(index); final String local = currentAtts.getLocalName(index); final String qname = currentAtts.getQName(index); final String value = currentAtts.getValue(index); currentAtts.removeAttribute(index); currentHandler.enterAttribute(uri,local,qname); currentHandler.text(value); currentHandler.leaveAttribute(uri,local,qname); }
/** * Set the type of a specific attribute. * * @param index The index of the attribute (zero-based). * @param type The attribute's type. * @exception java.lang.ArrayIndexOutOfBoundsException When the * supplied index does not point to an attribute * in the list. */ public void setType (int index, String type) { if (index >= 0 && index < length) { data[index*5+3] = type; } else { badIndex(index); } }
/** * Cleans up all the data structure so that the object can be reused later. * Normally, applications do not need to call this method directly, * * as the runtime resets itself after the endDocument method. */ public void reset() { attStack.clear(); currentAtts = null; currentHandler = null; indent=0; locator = null; namespaces.clear(); needIndent = true; redirect = null; redirectionDepth = 0; text = new StringBuffer(); // add a dummy attributes at the bottom as a "centinel." attStack.push(new AttributesImpl()); }
public int getAttributeIndex(String uri, String localname) { return currentAtts.getIndex(uri, localname); } public void consumeAttribute(int index) throws SAXException {
/** * Copy an entire Attributes object. * * <p>It may be more efficient to reuse an existing object * rather than constantly allocating new ones.</p> * * @param atts The attributes to copy. */ public void setAttributes (Attributes atts) { clear(); length = atts.getLength(); data = new String[length*5]; for (int i = 0; i < length; i++) { data[i*5] = atts.getURI(i); data[i*5+1] = atts.getLocalName(i); data[i*5+2] = atts.getQName(i); data[i*5+3] = atts.getType(i); data[i*5+4] = atts.getValue(i); } }