|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.simonstl.moe.namespace.NamespaceContext
The NamespaceContextI interface is a test implementation of NamespaceContextI.
Version 0.01 is the beginning of the class.
| Field Summary | |
protected int |
level
|
protected boolean |
modified
|
protected java.util.ArrayList |
namespaceStack
|
protected java.util.HashMap |
nsByPrefix
|
protected java.util.HashMap |
nsByURI
|
| Constructor Summary | |
NamespaceContext()
|
|
| Method Summary | |
NamespaceContextI |
collectContext(CoreComponentI component)
collectContext() builds a new namespaceContextI object by walking up the tree from the component used as a parameter. |
void |
declarePrefix(Namespace namespace)
Declares a mapping between a prefix and a URI at the current tree level. |
void |
declarePrefix(java.lang.String prefix,
java.lang.String URI)
Declares a mapping between a prefix and a URI at the current tree level. |
protected void |
generateSets()
|
java.lang.String |
getFullDeclaration()
Returns a full set of namespace declarations for the current context. |
int |
getLevel()
getLevel() returns the current position of the stack. |
java.util.HashMap |
getNamespacesByPrefixes()
Returns an enumeration of all the prefixes and URIs in the current context, keyed to prefix. |
java.util.HashMap |
getNamespacesByURIs()
Returns an enumeration of all the prefixes and URIs in the current context, keyed to URI. |
java.lang.String |
getPrefix(java.lang.String URI)
Given a prefix, it returns the URI to which that prefix maps. |
java.lang.String |
getURI(java.lang.String prefix)
Given a URI, it returns the first prefix it finds matching it. |
boolean |
isDeclared(java.lang.String prefix,
java.lang.String URI)
isDeclared() says whether a particular URI/prefix combination has been declared. |
static void |
main(java.lang.String[] args)
|
void |
popLevel()
popLevel() is called when an element ends, and strips out old namespace declarations which no longer apply. |
static void |
printPop(NamespaceContext subject)
|
static void |
printPush(NamespaceContext subject)
|
void |
pushLevel()
pushLevel() is called when an element starts, and doesn't have much to do. |
protected boolean |
removeNamespaces(int removeLevel)
|
void |
reset()
reset() is called when the object needs to be emptied for reuse. |
void |
setParent(CoreComponentI _parent)
Not sure if this goes here or in NamespaceSetI or anywhere |
static boolean |
test()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected int level
protected boolean modified
protected java.util.ArrayList namespaceStack
protected java.util.HashMap nsByPrefix
protected java.util.HashMap nsByURI
| Constructor Detail |
public NamespaceContext()
| Method Detail |
public void declarePrefix(java.lang.String prefix,
java.lang.String URI)
NamespaceContextIdeclarePrefix in interface NamespaceContextIpublic void declarePrefix(Namespace namespace)
NamespaceContextIdeclarePrefix in interface NamespaceContextIprotected void generateSets()
public java.lang.String getURI(java.lang.String prefix)
NamespaceContextIgetURI in interface NamespaceContextIpublic java.lang.String getPrefix(java.lang.String URI)
NamespaceContextIgetPrefix in interface NamespaceContextIpublic java.util.HashMap getNamespacesByPrefixes()
NamespaceContextIgetNamespacesByPrefixes in interface NamespaceContextIpublic java.util.HashMap getNamespacesByURIs()
NamespaceContextIgetNamespacesByURIs in interface NamespaceContextIpublic java.lang.String getFullDeclaration()
NamespaceContextIgetFullDeclaration in interface NamespaceContextIpublic void setParent(CoreComponentI _parent)
NamespaceContextIsetParent in interface NamespaceContextI
public boolean isDeclared(java.lang.String prefix,
java.lang.String URI)
NamespaceContextIisDeclared in interface NamespaceContextIpublic void pushLevel()
NamespaceContextIpushLevel in interface NamespaceContextIpublic void popLevel()
NamespaceContextIpopLevel in interface NamespaceContextIprotected boolean removeNamespaces(int removeLevel)
public int getLevel()
NamespaceContextIgetLevel in interface NamespaceContextIpublic void reset()
NamespaceContextIreset in interface NamespaceContextIpublic NamespaceContextI collectContext(CoreComponentI component)
NamespaceContextIcollectContext in interface NamespaceContextIpublic static void printPush(NamespaceContext subject)
public static void printPop(NamespaceContext subject)
public static boolean test()
public static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||