Package org.zkoss.idom
Class Namespace
java.lang.Object
org.zkoss.idom.Namespace
- All Implemented Interfaces:
Serializable,Cloneable
Represents the namespace.
A namespace is immutable, so you have to get a new one
- Author:
- tomyeh
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()booleanNote: equals() is based on URI only.final booleanTests whether two namespace are the same in both prefix and namespace URI.final StringGets the prefix mapped to this Namespace.static NamespacegetSpecial(String prefix) Returns the special namespace if prefix is special, or null if not.final StringgetURI()Gets the namespace URI for this Namespace.inthashCode()Note: hashCode() is based on URI only.final StringGets the tag name of the giving local name.toString()
-
Field Details
-
NO_NAMESPACE
TheNamespacefor when not in a namespace -
XML_NAMESPACE
The xml namespace. -
XMLNS_NAMESPACE
The xmlns namespace.
-
-
Constructor Details
-
Namespace
Constructor.- Parameters:
prefix- String prefix to map to this namespace.uri- String URI for namespace.- Throws:
DOMException- with NAMESPACE_ERR if the given prefix and uri is invalid
-
-
Method Details
-
getSpecial
Returns the special namespace if prefix is special, or null if not. -
tagNameOf
Gets the tag name of the giving local name. -
getPrefix
Gets the prefix mapped to this Namespace. -
getURI
Gets the namespace URI for this Namespace. -
equalsAll
Tests whether two namespace are the same in both prefix and namespace URI. On the other hand, equals check only the namespace URI.Note: unlike equals, it throws DOMException if prefix is the same but URI is different.
- Throws:
DOMException- if they have the same prefix but with different namespace URI
-
clone
-
equals
Note: equals() is based on URI only. -
hashCode
public int hashCode()Note: hashCode() is based on URI only. -
toString
-