public final class XmlSchemaNamespaceContext extends Object implements org.apache.ws.commons.schema.utils.NamespacePrefixList
NamespaceContext
.
Implemented as a series of scope-based stacks, one per prefix.
Constructor and Description |
---|
XmlSchemaNamespaceContext()
Constructs a new
XmlSchemaNamespaceContext with the
following initial mappings:
xml -> http://www.w3.org/1999/namespace
xmlns -> http://www.w3.org/2000/xmlns/
|
Modifier and Type | Method and Description |
---|---|
void |
addNamespace(String prefix,
String namespaceUri)
Adds a new prefix mapping to the context.
|
void |
clear()
Clears the given namespace stack, restoring it to the original mappings
defined by the constructor.
|
String[] |
getDeclaredPrefixes() |
String |
getNamespaceURI(String prefix) |
String |
getPrefix(String namespaceUri) |
Iterator |
getPrefixes(String namespaceUri) |
void |
removeNamespace(String prefix)
Removes the most recent prefix-to-namespace mapping for the provided
prefix.
|
public XmlSchemaNamespaceContext()
XmlSchemaNamespaceContext
with the
following initial mappings:
xml
-> http://www.w3.org/1999/namespace
xmlns
-> http://www.w3.org/2000/xmlns/
public String getNamespaceURI(String prefix)
getNamespaceURI
in interface NamespaceContext
NamespaceContext.getNamespaceURI(String)
public String getPrefix(String namespaceUri)
getPrefix
in interface NamespaceContext
NamespaceContext.getPrefix(String)
public Iterator getPrefixes(String namespaceUri)
getPrefixes
in interface NamespaceContext
NamespaceContext.getPrefixes(String)
public String[] getDeclaredPrefixes()
getDeclaredPrefixes
in interface org.apache.ws.commons.schema.utils.NamespacePrefixList
NamespacePrefixList.getDeclaredPrefixes()
public void addNamespace(String prefix, String namespaceUri)
prefix
- The prefix to represent the namespace URI.namespaceUri
- the namespace URI represented by the prefix.IllegalArgumentException
- if the prefix is null, or if the
namespace URI is null or empty.public void removeNamespace(String prefix)
prefix
- The prefix to remove the current prefix-to-namespace
mapping of.IllegalStateException
- If there is no current mapping for that
prefix.public void clear()
Copyright © 2004–2017 The Apache Software Foundation. All rights reserved.