|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.smallx.xml.infoset.NamespaceScope
This class represents a namespace scope. An instance of this may be attached to a parent scope and represent a heirarchical chain of scopes.
Nested Class Summary | |
static class |
NamespaceScope.NotDeclared
An exception throw when a prefix is not declared. |
Constructor Summary | |
NamespaceScope(NamespaceScope parent,
NamespaceDataProxy proxy)
Constructs an empty namespace scope with a parent scope. |
Method Summary | |
Name |
expandName(java.lang.String name)
Expands a qname into a name instance. |
Name |
expandName(java.lang.String name,
boolean useDefault)
Expands a qname into a name instance. |
Name |
expandName(java.lang.String name,
boolean useDefault,
NameTable table)
|
NamespaceDataProxy |
getDataProxy()
Sets the namespace scope's parent (very dangerous!). |
java.net.URI |
getNamespace(java.lang.String prefix)
Returns an in-scope namespace name mapping for this prefix. |
java.lang.String |
getNearestPrefix(java.net.URI namespace)
Returns the nearest in-scope prefix for a namespace name. |
NamespaceScope |
getParent()
Returns the parent scope. |
java.lang.String |
getPrefix(Name name)
Returns the appropriate prefix to use with the specified name. |
java.util.Iterator |
getPrefixes()
Returns all the in-scope prefixes. |
java.lang.String |
toQName(Name nm,
boolean element)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public NamespaceScope(NamespaceScope parent, NamespaceDataProxy proxy)
parent
- The parent scope.Method Detail |
public NamespaceScope getParent()
public NamespaceDataProxy getDataProxy()
public Name expandName(java.lang.String name) throws XMLException
name
- The qname value to expand.
XMLException
- Throw when the prefix is not declared or the qname is invalid.public Name expandName(java.lang.String name, boolean useDefault) throws XMLException
name
- The qname value to expand.useDefault
- a flag indicating if the default should be used for names without prefixes.
XMLException
- Throw when the prefix is not declared or the qname is invalid.public Name expandName(java.lang.String name, boolean useDefault, NameTable table) throws XMLException
XMLException
public java.lang.String toQName(Name nm, boolean element)
public java.util.Iterator getPrefixes()
public java.net.URI getNamespace(java.lang.String prefix)
prefix
- The prefix string with which to search.
public java.lang.String getNearestPrefix(java.net.URI namespace)
namespace
- The namespace with which to search.
public java.lang.String getPrefix(Name name) throws NamespaceScope.NotDeclared
name
- The name to use in the search.
NamespaceScope.NotDeclared
- Thrown when a namespace name is specified on the name and there is no in-scope prefix or default namespace name that matches the URI value.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |