Package com.sun.msv.writer
Class ContentHandlerAdaptor.AttributeListAdapter
- java.lang.Object
-
- com.sun.msv.writer.ContentHandlerAdaptor.AttributeListAdapter
-
- All Implemented Interfaces:
org.xml.sax.Attributes
- Enclosing class:
- ContentHandlerAdaptor
final class ContentHandlerAdaptor.AttributeListAdapter extends java.lang.Object implements org.xml.sax.AttributesAdapt 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 Summary
Fields Modifier and Type Field Description private org.xml.sax.AttributeListqAtts
-
Constructor Summary
Constructors Constructor Description AttributeListAdapter()Construct a new adapter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetIndex(java.lang.String qName)Look up an attribute index by qualified (prefixed) name.intgetIndex(java.lang.String uri, java.lang.String localName)Look up an attribute index by Namespace name.intgetLength()Return the length of the attribute list.java.lang.StringgetLocalName(int i)Return the local name of the specified attribute.java.lang.StringgetQName(int i)Return the qualified (prefixed) name of the specified attribute.java.lang.StringgetType(int i)Return the type of the specified attribute.java.lang.StringgetType(java.lang.String qName)Look up the type of an attribute by qualified (prefixed) name.java.lang.StringgetType(java.lang.String uri, java.lang.String localName)Look up the type of an attribute by Namespace name.java.lang.StringgetURI(int i)Return the Namespace URI of the specified attribute.java.lang.StringgetValue(int i)Return the value of the specified attribute.java.lang.StringgetValue(java.lang.String qName)Look up the value of an attribute by qualified (prefixed) name.java.lang.StringgetValue(java.lang.String uri, java.lang.String localName)Look up the value of an attribute by Namespace name.(package private) voidsetAttributeList(org.xml.sax.AttributeList qAtts)Set the embedded AttributeList.
-
-
-
Method Detail
-
setAttributeList
void setAttributeList(org.xml.sax.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:
getLengthin interfaceorg.xml.sax.Attributes- Returns:
- The number of attributes in the list.
- See Also:
Attributes.getLength()
-
getURI
public java.lang.String getURI(int i)
Return the Namespace URI of the specified attribute.- Specified by:
getURIin interfaceorg.xml.sax.Attributes- Parameters:
The- attribute's index.- Returns:
- Always the empty string.
- See Also:
Attributes.getURI(int)
-
getLocalName
public java.lang.String getLocalName(int i)
Return the local name of the specified attribute.- Specified by:
getLocalNamein interfaceorg.xml.sax.Attributes- Parameters:
The- attribute's index.- Returns:
- Always the empty string.
- See Also:
Attributes.getLocalName(int)
-
getQName
public java.lang.String getQName(int i)
Return the qualified (prefixed) name of the specified attribute.- Specified by:
getQNamein interfaceorg.xml.sax.Attributes- Parameters:
The- attribute's index.- Returns:
- The attribute's qualified name, internalized.
-
getType
public java.lang.String getType(int i)
Return the type of the specified attribute.- Specified by:
getTypein interfaceorg.xml.sax.Attributes- Parameters:
The- attribute's index.- Returns:
- The attribute's type as an internalized string.
-
getValue
public java.lang.String getValue(int i)
Return the value of the specified attribute.- Specified by:
getValuein interfaceorg.xml.sax.Attributes- Parameters:
The- attribute's index.- Returns:
- The attribute's value.
-
getIndex
public int getIndex(java.lang.String uri, java.lang.String localName)Look up an attribute index by Namespace name.- Specified by:
getIndexin interfaceorg.xml.sax.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:
Attributes.getIndex(java.lang.String,java.lang.String)
-
getIndex
public int getIndex(java.lang.String qName)
Look up an attribute index by qualified (prefixed) name.- Specified by:
getIndexin interfaceorg.xml.sax.Attributes- Parameters:
qName- The qualified name.- Returns:
- The attributes index, or -1 if none was found.
- See Also:
Attributes.getIndex(java.lang.String)
-
getType
public java.lang.String getType(java.lang.String uri, java.lang.String localName)Look up the type of an attribute by Namespace name.- Specified by:
getTypein interfaceorg.xml.sax.Attributes- Parameters:
uri- The Namespace URIlocalName- The local name.- Returns:
- The attribute's type as an internalized string.
-
getType
public java.lang.String getType(java.lang.String qName)
Look up the type of an attribute by qualified (prefixed) name.- Specified by:
getTypein interfaceorg.xml.sax.Attributes- Parameters:
qName- The qualified name.- Returns:
- The attribute's type as an internalized string.
-
getValue
public java.lang.String getValue(java.lang.String uri, java.lang.String localName)Look up the value of an attribute by Namespace name.- Specified by:
getValuein interfaceorg.xml.sax.Attributes- Parameters:
uri- The Namespace URIlocalName- The local name.- Returns:
- The attribute's value.
-
getValue
public java.lang.String getValue(java.lang.String qName)
Look up the value of an attribute by qualified (prefixed) name.- Specified by:
getValuein interfaceorg.xml.sax.Attributes- Parameters:
qName- The qualified name.- Returns:
- The attribute's value.
-
-