Class ContentHandlerAdaptor.AttributeListAdapter

java.lang.Object
com.sun.msv.writer.ContentHandlerAdaptor.AttributeListAdapter
All Implemented Interfaces:
Attributes
Enclosing class:
ContentHandlerAdaptor

final class ContentHandlerAdaptor.AttributeListAdapter extends Object implements Attributes
Adapt a SAX1 AttributeList as a SAX2 Attributes object.

This class is in the Public Domain, and comes with NO WARRANTY of any kind.

This wrapper class is used only when Namespace support is disabled -- it provides pretty much a direct mapping from SAX1 to SAX2, except that names and types are interned whenever requested.

  • Field Details

  • Constructor Details

    • AttributeListAdapter

      AttributeListAdapter()
      Construct a new adapter.
  • Method Details

    • setAttributeList

      void setAttributeList(AttributeList qAtts)
      Set the embedded AttributeList.

      This method must be invoked before any of the others can be used.

      Parameters:
      The - SAX1 attribute list (with qnames).
    • getLength

      public int getLength()
      Return the length of the attribute list.
      Specified by:
      getLength in interface Attributes
      Returns:
      The number of attributes in the list.
      See Also:
    • getURI

      public String getURI(int i)
      Return the Namespace URI of the specified attribute.
      Specified by:
      getURI in interface Attributes
      Parameters:
      The - attribute's index.
      Returns:
      Always the empty string.
      See Also:
    • getLocalName

      public String getLocalName(int i)
      Return the local name of the specified attribute.
      Specified by:
      getLocalName in interface Attributes
      Parameters:
      The - attribute's index.
      Returns:
      Always the empty string.
      See Also:
    • getQName

      public String getQName(int i)
      Return the qualified (prefixed) name of the specified attribute.
      Specified by:
      getQName in interface Attributes
      Parameters:
      The - attribute's index.
      Returns:
      The attribute's qualified name, internalized.
    • getType

      public String getType(int i)
      Return the type of the specified attribute.
      Specified by:
      getType in interface Attributes
      Parameters:
      The - attribute's index.
      Returns:
      The attribute's type as an internalized string.
    • getValue

      public String getValue(int i)
      Return the value of the specified attribute.
      Specified by:
      getValue in interface Attributes
      Parameters:
      The - attribute's index.
      Returns:
      The attribute's value.
    • getIndex

      public int getIndex(String uri, String localName)
      Look up an attribute index by Namespace name.
      Specified by:
      getIndex in interface Attributes
      Parameters:
      uri - The Namespace URI or the empty string.
      localName - The local name.
      Returns:
      The attributes index, or -1 if none was found.
      See Also:
    • getIndex

      public int getIndex(String qName)
      Look up an attribute index by qualified (prefixed) name.
      Specified by:
      getIndex in interface Attributes
      Parameters:
      qName - The qualified name.
      Returns:
      The attributes index, or -1 if none was found.
      See Also:
    • getType

      public String getType(String uri, String localName)
      Look up the type of an attribute by Namespace name.
      Specified by:
      getType in interface Attributes
      Parameters:
      uri - The Namespace URI
      localName - The local name.
      Returns:
      The attribute's type as an internalized string.
    • getType

      public String getType(String qName)
      Look up the type of an attribute by qualified (prefixed) name.
      Specified by:
      getType in interface Attributes
      Parameters:
      qName - The qualified name.
      Returns:
      The attribute's type as an internalized string.
    • getValue

      public String getValue(String uri, String localName)
      Look up the value of an attribute by Namespace name.
      Specified by:
      getValue in interface Attributes
      Parameters:
      uri - The Namespace URI
      localName - The local name.
      Returns:
      The attribute's value.
    • getValue

      public String getValue(String qName)
      Look up the value of an attribute by qualified (prefixed) name.
      Specified by:
      getValue in interface Attributes
      Parameters:
      qName - The qualified name.
      Returns:
      The attribute's value.