gnu.xml
Class NamespaceBinding
- Externalizable
public final class NamespaceBinding
extends java.lang.Object
implements Externalizable
A "namespace node" as a link in a linked list.
The list may contain duplicates - i.e. multiple namespace bindings
for the same prefix but (usually) different uris. In that case the
first binding "wins". One reason for allowing duplicates it to allow
sharing of the lists between a child and its parent element.
XML_NAMESPACE
public static final String XML_NAMESPACE
NamespaceBinding
public NamespaceBinding(String prefix,
String uri,
NamespaceBinding next)
count
public int count(NamespaceBinding fencePost)
Return the number of bindings before the fencePost
.
getPrefix
public final String getPrefix()
Namespace prefix. An interned String.
A default namespace declaration is represented using null.
getUri
public final String getUri()
Namespace uri. An interned String.
The value null "undeclares" any following namespaces; it corresponds
to an empty uri as in the XML Namespaces 1.1 Candidate Recommendation.
readExternal
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
resolve
public String resolve(String prefix)
Resolve a prefix.
prefix
- an interned namespace prefix to search for.
- a uri or null if not bound
resolve
public String resolve(String prefix,
NamespaceBinding fencePost)
Resolve a prefix, in the initial part of this list.
prefix
- an interned namespace prefix to search for.fencePost
- only search this list until then.
- a uri or null if not bound
setPrefix
public final void setPrefix(String prefix)
setUri
public final void setUri(String uri)
toString
public String toString()
Return a String showing just a single namespace binding.
toStringAll
public String toStringAll()
Return a String showing the full namespace binding list.
writeExternal
public void writeExternal(ObjectOutput out)
throws IOException