com.simonstl.common
Class NSDecl

java.lang.Object
  |
  +--com.simonstl.common.NSDecl
All Implemented Interfaces:
NamingI

public class NSDecl
extends java.lang.Object
implements NamingI

Derived from com.simonstl.moe.NamespaceDecl and com.simonstl.midp.xml.TAMNSDecl. This class stores namespace declaration information.

Version:
0.02 11 December 2002
Author:
Simon St.Laurent

Field Summary
protected  boolean current
          current indicates that a namespace needs to be declared in the current context.
protected  int level
          level is used to determine where in a tree a given namespace applies.
protected  java.lang.String name
           
protected  java.lang.String value
           
 
Constructor Summary
NSDecl()
           
 
Method Summary
 int getLevel()
          getLevel()is used by the namespace context object to figure out which declarations appeared where.
 java.lang.String getLocalName()
          Returns the local name for the component
 java.lang.String getPrefix()
          Prefix for namespaces is always xmlns.
 java.lang.String getQName()
          Returns the Qualified Name (QName) for the component.
 java.lang.String getUri()
          Namespace URIs for namespace declarations are always http://www.w3.org/TR/REC-xml-names/.
 java.lang.String getValue()
          The value contains the namespace URI.
 int hashCode()
          The hashCode() method uses nsURI+">"+localName to generate an int.
 void setLevel(int _level)
          setLevel()is used by the namespace context object to establish which declarations appeared where.
 void setLocalName(java.lang.String _localName)
          Use setLocalName to identify the namespace prefix being used.
 void setPrefix(java.lang.String prefix)
          Attempts to set prefixes on namespace names will be ignored.
 void setQName(java.lang.String QName)
          currently null; needs work.
 void setUri(java.lang.String nsURI)
          Attempts to set URIs on namespace names will be ignored.
 void setValue(java.lang.String _value)
          The value contains the namespace URI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.simonstl.common.NamingI
equals
 

Field Detail

level

protected int level
level is used to determine where in a tree a given namespace applies.


current

protected boolean current
current indicates that a namespace needs to be declared in the current context. If events came through a SAX filter stripping xmlns attributes, this is useful.


name

protected java.lang.String name

value

protected java.lang.String value
Constructor Detail

NSDecl

public NSDecl()
Method Detail

getPrefix

public java.lang.String getPrefix()
Prefix for namespaces is always xmlns.

Specified by:
getPrefix in interface NamingI

hashCode

public int hashCode()
The hashCode() method uses nsURI+">"+localName to generate an int. If you need something more precise, you'll need to override this.

Specified by:
hashCode in interface NamingI
Overrides:
hashCode in class java.lang.Object

setPrefix

public void setPrefix(java.lang.String prefix)
Attempts to set prefixes on namespace names will be ignored.

Specified by:
setPrefix in interface NamingI

getUri

public java.lang.String getUri()
Namespace URIs for namespace declarations are always http://www.w3.org/TR/REC-xml-names/.

Specified by:
getUri in interface NamingI

setUri

public void setUri(java.lang.String nsURI)
Attempts to set URIs on namespace names will be ignored.

Specified by:
setUri in interface NamingI

getLocalName

public java.lang.String getLocalName()
Description copied from interface: NamingI
Returns the local name for the component

Specified by:
getLocalName in interface NamingI

setLocalName

public void setLocalName(java.lang.String _localName)
Use setLocalName to identify the namespace prefix being used.

Specified by:
setLocalName in interface NamingI

getQName

public java.lang.String getQName()
Returns the Qualified Name (QName) for the component. Overrides the usual QName approach because of the different approach used by Namespaces in XML.

Specified by:
getQName in interface NamingI

setQName

public void setQName(java.lang.String QName)
currently null; needs work.

Specified by:
setQName in interface NamingI

getLevel

public int getLevel()
getLevel()is used by the namespace context object to figure out which declarations appeared where.


setLevel

public void setLevel(int _level)
setLevel()is used by the namespace context object to establish which declarations appeared where.


getValue

public java.lang.String getValue()
The value contains the namespace URI.


setValue

public void setValue(java.lang.String _value)
The value contains the namespace URI.