com.simonstl.moe
Class NamespaceName

java.lang.Object
  |
  +--com.simonstl.moe.NamespaceName
All Implemented Interfaces:
java.lang.Cloneable, NamingI

public class NamespaceName
extends java.lang.Object
implements NamingI

The NamespaceName class provides a foundation for MOE objects to store namespaces.

I've defined the Namespace class to be something of a broken name, much like Namespace declarations in XML 1.0. The prefix of the attribute is fixed to xmlns, the localName defines the prefix defined by the namespace. The toString() method handles the xmlns/xmlns:prefix issues.

All of the processing of the NamingI interface is delegated to a NamespaceName object.

nsURI is fixed to http://www.w3.org/TR/REC-xml-names/.

version 0.01 is the initial release and contains plenty of bogus placeholder functionality.

Version:
0.01 1 September 2001
Author:
Simon St.Laurent

Field Summary
protected  java.lang.String localName
          contains the prefix used by the namespace (if any)
 
Constructor Summary
NamespaceName()
           
 
Method Summary
 java.lang.Object clone()
          Clones the name.
 boolean equals(java.lang.Object _name)
           
 java.lang.String getLocalName()
          Returns the local name for the component
 java.lang.String getNsURI()
          Returns the URI reference value for the namespace.
 java.lang.String getPrefix()
          Prefix for namespaces is always xmlns.
 java.lang.String getQName()
          Returns the Qualified Name (QName) for the component.
 int hashCode()
          The hashCode() method uses xmlns(:prefix) to generate an int.
 void setLocalName(java.lang.String _localName)
          Use setLocalName to identify the namespace prefix being used.
 void setNsURI(java.lang.String nsURI)
          Accepts a URI reference value which is used as the namespace for the component.
 void setPrefix(java.lang.String prefix)
          Attempts to set prefixes on namespace names will be ignored.
 void setQName(java.lang.String QName)
          Sets the Qualified Name (QName) for the component.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

localName

protected java.lang.String localName
contains the prefix used by the namespace (if any)
Constructor Detail

NamespaceName

public NamespaceName()
Method Detail

hashCode

public int hashCode()
The hashCode() method uses xmlns(:prefix) 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

getPrefix

public java.lang.String getPrefix()
Prefix for namespaces is always xmlns.
Specified by:
getPrefix in interface NamingI

setPrefix

public void setPrefix(java.lang.String prefix)
Attempts to set prefixes on namespace names will be ignored.
Specified by:
setPrefix in interface NamingI

getNsURI

public java.lang.String getNsURI()
Description copied from interface: NamingI
Returns the URI reference value for the namespace.
Specified by:
getNsURI in interface NamingI

setNsURI

public void setNsURI(java.lang.String nsURI)
Description copied from interface: NamingI
Accepts a URI reference value which is used as the namespace for the component.
Specified by:
setNsURI 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)
Sets the Qualified Name (QName) for the component. Overrides the usual QName approach because of the different approach used by Namespaces in XML.
Specified by:
setQName in interface NamingI

toString

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

equals

public boolean equals(java.lang.Object _name)
Overrides:
equals in class java.lang.Object

clone

public java.lang.Object clone()
Clones the name.
Specified by:
clone in interface NamingI
Overrides:
clone in class java.lang.Object