public final class SavedNamespaceContext extends java.lang.Object implements NamespaceResolver
Constructor and Description |
---|
SavedNamespaceContext(java.lang.Iterable<NamespaceBinding> nsBindings)
Create a NamespaceContext object
|
SavedNamespaceContext(java.util.Iterator<NamespaceBinding> nsBindings)
Create a NamespaceContext object
|
SavedNamespaceContext(java.util.Iterator<NamespaceBinding> nsBindings,
java.util.function.Predicate<NamespaceBinding> excluded)
Create a NamespaceContext object, excluding some namespaces
|
SavedNamespaceContext(NamespaceResolver resolver)
Create a SavedNamespaceContext that captures all the information in a given NamespaceResolver
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Compare this saved namespace context to another (so that they can be shared)
|
java.lang.String |
getURIForPrefix(java.lang.String prefix,
boolean useDefault)
Get the namespace URI corresponding to a given prefix.
|
int |
hashCode() |
java.util.Iterator<java.lang.String> |
iteratePrefixes()
Get an iterator over all the prefixes declared in this namespace context.
|
public SavedNamespaceContext(java.lang.Iterable<NamespaceBinding> nsBindings)
nsBindings
- an array of namespace bindings. Each namespace code is an integer
in which the first 16 bits represent the prefix (zero if it's the default namespace)
and the next 16 bits represent the uri. These are codes held in the NamePool. The
list will be searched from the "high" end.public SavedNamespaceContext(java.util.Iterator<NamespaceBinding> nsBindings)
nsBindings
- an array of namespace bindings. Each namespace code is an integer
in which the first 16 bits represent the prefix (zero if it's the default namespace)
and the next 16 bits represent the uri. These are codes held in the NamePool. The
list will be searched from the "high" end.public SavedNamespaceContext(java.util.Iterator<NamespaceBinding> nsBindings, java.util.function.Predicate<NamespaceBinding> excluded)
nsBindings
- an array of namespace bindings. Each namespace code is an integer
in which the first 16 bits represent the prefix (zero if it's the default namespace)
and the next 16 bits represent the uri. These are codes held in the NamePool. The
list will be searched from the "high" end.public SavedNamespaceContext(NamespaceResolver resolver)
resolver
- the NamespaceResolverpublic java.lang.String getURIForPrefix(java.lang.String prefix, boolean useDefault)
getURIForPrefix
in interface NamespaceResolver
prefix
- the namespace prefixuseDefault
- true if the default namespace is to be used when the
prefix is ""public java.util.Iterator<java.lang.String> iteratePrefixes()
iteratePrefixes
in interface NamespaceResolver
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the other namespace contextpublic int hashCode()
hashCode
in class java.lang.Object
Copyright (c) 2004-2020 Saxonica Limited. All rights reserved.