|
|||||||||
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)
NamespaceContextI
declarePrefix
in interface NamespaceContextI
public void declarePrefix(Namespace namespace)
NamespaceContextI
declarePrefix
in interface NamespaceContextI
protected void generateSets()
public java.lang.String getURI(java.lang.String prefix)
NamespaceContextI
getURI
in interface NamespaceContextI
public java.lang.String getPrefix(java.lang.String URI)
NamespaceContextI
getPrefix
in interface NamespaceContextI
public java.util.HashMap getNamespacesByPrefixes()
NamespaceContextI
getNamespacesByPrefixes
in interface NamespaceContextI
public java.util.HashMap getNamespacesByURIs()
NamespaceContextI
getNamespacesByURIs
in interface NamespaceContextI
public java.lang.String getFullDeclaration()
NamespaceContextI
getFullDeclaration
in interface NamespaceContextI
public void setParent(CoreComponentI _parent)
NamespaceContextI
setParent
in interface NamespaceContextI
public boolean isDeclared(java.lang.String prefix, java.lang.String URI)
NamespaceContextI
isDeclared
in interface NamespaceContextI
public void pushLevel()
NamespaceContextI
pushLevel
in interface NamespaceContextI
public void popLevel()
NamespaceContextI
popLevel
in interface NamespaceContextI
protected boolean removeNamespaces(int removeLevel)
public int getLevel()
NamespaceContextI
getLevel
in interface NamespaceContextI
public void reset()
NamespaceContextI
reset
in interface NamespaceContextI
public NamespaceContextI collectContext(CoreComponentI component)
NamespaceContextI
collectContext
in interface NamespaceContextI
public 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 |