org.apache.crimson.parser
Class AttributesExImpl

java.lang.Object
  extended byorg.xml.sax.helpers.AttributesImpl
      extended byorg.apache.crimson.parser.AttributesExImpl
All Implemented Interfaces:
org.xml.sax.Attributes, AttributesEx

final class AttributesExImpl
extends org.xml.sax.helpers.AttributesImpl
implements AttributesEx

Implementation of the AttributesEx interface which provides additional features to support editor-oriented DOM features: exposing attribute defaulting. Derived from old AttributeListImpl.java code.


Field Summary
private  Vector defaults
           
private  String idAttributeName
           
private  Vector specified
           
 
Fields inherited from class org.xml.sax.helpers.AttributesImpl
 
Constructor Summary
(package private) AttributesExImpl()
           
 
Method Summary
 void addAttribute(String uri, String localName, String qName, String type, String value, String defaultValue, boolean isSpecified)
          Add an attribute to this list
 void clear()
          Clears the attribute list so it has no members
 String getDefault(int i)
          Return the default value of an attribute in this list (by position).
 String getIdAttributeName()
          Returns the name of the ID attribute.
 boolean isSpecified(int i)
          Returns true if the value was specified by a parsed document (by position; no by-name variant).
(package private)  void setIdAttributeName(String name)
          Allows parser to set the name of the ID attribute.
 
Methods inherited from class org.xml.sax.helpers.AttributesImpl
addAttribute, getIndex, getIndex, getLength, getLocalName, getQName, getType, getType, getType, getURI, getValue, getValue, getValue, removeAttribute, setAttribute, setAttributes, setLocalName, setQName, setType, setURI, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xml.sax.Attributes
getIndex, getIndex, getLength, getLocalName, getQName, getType, getType, getType, getURI, getValue, getValue, getValue
 

Field Detail

specified

private Vector specified

defaults

private Vector defaults

idAttributeName

private String idAttributeName
Constructor Detail

AttributesExImpl

AttributesExImpl()
Method Detail

clear

public void clear()
Clears the attribute list so it has no members


addAttribute

public void addAttribute(String uri,
                         String localName,
                         String qName,
                         String type,
                         String value,
                         String defaultValue,
                         boolean isSpecified)
Add an attribute to this list


isSpecified

public boolean isSpecified(int i)
Returns true if the value was specified by a parsed document (by position; no by-name variant).

Specified by:
isSpecified in interface AttributesEx
Parameters:
i - the index of the attribute in the list.

getDefault

public String getDefault(int i)
Return the default value of an attribute in this list (by position).

Specified by:
getDefault in interface AttributesEx
Parameters:
i - the index of the attribute in the list.

getIdAttributeName

public String getIdAttributeName()
Returns the name of the ID attribute.

Specified by:
getIdAttributeName in interface AttributesEx

setIdAttributeName

void setIdAttributeName(String name)
Allows parser to set the name of the ID attribute.