com.sun.xml.bind.v2.runtime.unmarshaller
Class TagName

java.lang.Object
  extended by com.sun.xml.bind.v2.runtime.unmarshaller.TagName

public abstract class TagName
extends java.lang.Object

Represents an XML tag name (and attributes for start tags.)

This object is used so reduce the number of method call parameters among unmarshallers. An instance of this is expected to be reused by the caller of XmlVisitor. Note that the rest of the unmarshaller may modify any of the fields while processing an event (such as to intern strings, replace attributes), so XmlVisitor should reset all fields for each use.

The 'qname' parameter, which holds the qualified name of the tag (such as 'foo:bar' or 'zot'), is not used in the typical unmarshalling route and it's also expensive to compute for some input. Thus this parameter is computed lazily.


Field Summary
 org.xml.sax.Attributes atts
          Used only for the enterElement event.
 java.lang.String local
          Local part of the attribute/element name.
 java.lang.String uri
          URI of the attribute/element name.
 
Constructor Summary
TagName()
           
 
Method Summary
 javax.xml.namespace.QName createQName()
          Creates QName.
 java.lang.String getPrefix()
          Gets the prefix.
abstract  java.lang.String getQname()
          Gets the qualified name of the tag.
 boolean matches(Name name)
          Checks if the given name pair matches this name.
 boolean matches(java.lang.String nsUri, java.lang.String local)
          Checks if the given name pair matches this name.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

uri

public java.lang.String uri
URI of the attribute/element name. Can be empty, but never null. Interned.


local

public java.lang.String local
Local part of the attribute/element name. Never be null. Interned.


atts

public org.xml.sax.Attributes atts
Used only for the enterElement event. Otherwise the value is undefined. This might be AttributesEx.

Constructor Detail

TagName

public TagName()
Method Detail

matches

public final boolean matches(java.lang.String nsUri,
                             java.lang.String local)
Checks if the given name pair matches this name.


matches

public final boolean matches(Name name)
Checks if the given name pair matches this name.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getQname

public abstract java.lang.String getQname()
Gets the qualified name of the tag.

Returns:
never null.

getPrefix

public java.lang.String getPrefix()
Gets the prefix. This is slow.

Returns:
can be "" but never null.

createQName

public javax.xml.namespace.QName createQName()
Creates QName.