|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.cocoon.stax.converter.util.SimpleNamespaceContext
public class SimpleNamespaceContext
Simple NamespaceContext implementation backed by a HashMap.
| Field Summary | |
|---|---|
protected Map |
namespaces
map containing bound namespaces, keyed by their prefix. |
protected NamespaceContext |
parent
The parent context, which may be null |
| Constructor Summary | |
|---|---|
SimpleNamespaceContext()
Constructs a SimpleNamespaceContext with no parent context or namespace declarations. |
|
SimpleNamespaceContext(Map namespaces)
Constructs a SimpleNamespaceContext with no parent context that contains the specified prefixes. |
|
SimpleNamespaceContext(NamespaceContext parent)
Constructs an empty SimpleNamespaceContext with the given parent. |
|
SimpleNamespaceContext(NamespaceContext parent,
Map namespaces)
Constructs an empty SimpleNamespaceContext with the given parent. |
|
| Method Summary | |
|---|---|
int |
getDeclaredPrefixCount()
Returns the number of namespace prefixes declared in this context. |
Iterator |
getDeclaredPrefixes()
Returns an Iterator of all namespace prefixes declared within this context,
irrespective of any ancestor contexts. |
String |
getNamespaceURI(String prefix)
|
NamespaceContext |
getParent()
Returns a reference to the parent of this context. |
String |
getPrefix(String nsURI)
|
Iterator |
getPrefixes()
Returns an Iterator of all namespace prefixes in scope within this context, including
those inherited from ancestor contexts. |
Iterator |
getPrefixes(String nsURI)
|
boolean |
isPrefixDeclared(String prefix)
Determines if the specified prefix is declared within this context, irrespective of any ancestor contexts. |
boolean |
isRootContext()
Determines if this is a root context. |
String |
setDefaultNamespace(String nsURI)
Sets the default namespace in this context. |
void |
setParent(NamespaceContext parent)
Sets the parent context used to inherit namespace bindings. |
String |
setPrefix(String prefix,
String nsURI)
Declares a namespace binding in this context. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected NamespaceContext parent
null
protected Map namespaces
getPrefix(String) always returns the same prefix, unless that prefix is
removed.
| Constructor Detail |
|---|
public SimpleNamespaceContext()
public SimpleNamespaceContext(Map namespaces)
namespaces - A Map of namespace URIs, keyed by their prefixes.public SimpleNamespaceContext(NamespaceContext parent)
parent - The parent context.
public SimpleNamespaceContext(NamespaceContext parent,
Map namespaces)
parent - The parent context.namespaces - A Map of namespace URIs, keyed by their prefixes.| Method Detail |
|---|
public NamespaceContext getParent()
getParent in interface ExtendedNamespaceContextnull if this is a root context.public void setParent(NamespaceContext parent)
parent - The new parent context.public boolean isRootContext()
true if this is a root context, false otherwise.public String getNamespaceURI(String prefix)
getNamespaceURI in interface NamespaceContextpublic String getPrefix(String nsURI)
getPrefix in interface NamespaceContextpublic boolean isPrefixDeclared(String prefix)
isPrefixDeclared in interface ExtendedNamespaceContextprefix - The prefix to check.
true if the prefix is declared in this context, false
otherwise.public Iterator getDeclaredPrefixes()
ExtendedNamespaceContextIterator of all namespace prefixes declared within this context,
irrespective of any ancestor contexts.
getDeclaredPrefixes in interface ExtendedNamespaceContextIterator of prefix Strings.public int getDeclaredPrefixCount()
public Iterator getPrefixes()
ExtendedNamespaceContextIterator of all namespace prefixes in scope within this context, including
those inherited from ancestor contexts.
getPrefixes in interface ExtendedNamespaceContextIterator of prefix Strings.public Iterator getPrefixes(String nsURI)
getPrefixes in interface NamespaceContextpublic String setDefaultNamespace(String nsURI)
nsURI - The default namespace URI.
null if the default prefix
wasn't previously declared in this context.
public String setPrefix(String prefix,
String nsURI)
prefix - The namespace prefix.nsURI - The namespace URI.
null if the prefix wasn't
previously declared in this context.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||