|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjd.xml.xpath.model.NamespaceContext
NamespaceContext provides information about namespace declarations. A single NamespaceContext object stores information about a single namespace declaration, i.e. prefix, uri and declaring element. A NamespaceContext object can be be connected to another NamespaceContext thus effectivly representing a chain of namespace declarations. The xml namespace itself and the undeclaration of the default namespace (xmlns="") are by design not representable by a NamespaceContext object.
Method Summary | |
static NamespaceContext |
add(String prefix,
String uri,
NamespaceContext first)
Create a NamespaceContext. |
int |
count()
Return the number of namespaces in this namespace chain. |
void |
dump(PrintStream out)
Dump the namespaces to the printstream. |
int |
getDeclarationId()
Return the declaration id. |
int |
getIndex()
Return the index of the NamespaceContext. |
String |
getPrefix()
Return the prefix of this NamespaceContext obect. |
static String |
getPrefix(NamespaceContext context,
String uri)
|
String |
getPrefix(String uri)
Return the prefix associated with the supplied uri. |
String |
getUri()
Return the uri of this NamespaceContext object. |
static String |
getUri(NamespaceContext context,
String prefix)
|
String |
getUri(String prefix)
Return the uri associated with the supplied prefix. |
NamespaceContext |
next()
Return the next NamespaceContext in this chain. |
static NamespaceContext |
remove(String prefix,
NamespaceContext first)
Remove a NamespaceContext. |
void |
setDeclarationId(int id)
Set the declaration id of this NamespaceContext. |
static void |
setDeclarationIds(NamespaceContext context,
int id)
Loop through the namespace chain and set the declaration id of all NamespaceContexts who have no declaration id, until the chain ends or a NamespaceContext with a declaration id is encountered. |
void |
setIndex(int index)
Set the index of the NamespaceContext. |
void |
setUri(String uri)
Set the uri of this NamespaceContext. |
String |
toString()
Return a string representation of this namespace. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
public static NamespaceContext add(String prefix, String uri, NamespaceContext first)
prefix
- the prefixuri
- the urifirst
- another NamespaceContext to which this NamespaceContext gets connected.
public static NamespaceContext remove(String prefix, NamespaceContext first)
prefix
- the prefix of the namespacefirst
-
public String getPrefix()
public String getPrefix(String uri)
public static String getPrefix(NamespaceContext context, String uri)
public void setUri(String uri)
public String getUri()
public String getUri(String prefix)
public static String getUri(NamespaceContext context, String prefix)
public void setDeclarationId(int id)
public int getDeclarationId()
public static void setDeclarationIds(NamespaceContext context, int id)
public NamespaceContext next()
public int count()
public int getIndex()
setIndex(int)
public void setIndex(int index)
getIndex()
public void dump(PrintStream out)
public String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |