|
BEA Systems, Inc. | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--weblogic.apache.xerces.util.NamespaceSupport
Namespace support for XML document handlers. This class doesn't perform any error checking and assumes that all strings passed as arguments to methods are unique symbols. The SymbolTable class can be used for this purpose.
Field Summary | |
protected int[] |
fContext
Context indexes. |
protected int |
fCurrentContext
The current context. |
protected java.lang.String[] |
fNamespace
Namespace binding information. |
protected int |
fNamespaceSize
The top of the namespace information array. |
Constructor Summary | |
NamespaceSupport()
Default constructor. |
|
NamespaceSupport(NamespaceContext context)
Constructs a namespace context object and initializes it with the prefixes declared in the specified context. |
Method Summary | |
boolean |
declarePrefix(java.lang.String prefix,
java.lang.String uri)
Declare a Namespace prefix. |
java.lang.String |
getDeclaredPrefixAt(int index)
Returns the prefix at the specified index in the current context. |
int |
getDeclaredPrefixCount()
Return a count of all prefixes currently declared, including the default prefix if bound. |
NamespaceContext |
getParentContext()
Returns the parent namespace context or null if there is no parent context. |
java.lang.String |
getPrefix(java.lang.String uri)
Look up a namespace URI and get one of the mapped prefix. |
java.lang.String |
getURI(java.lang.String prefix)
Look up a prefix and get the currently-mapped Namespace URI. |
void |
popContext()
Revert to the previous Namespace context. |
void |
pushContext()
Start a new Namespace context. |
void |
reset()
Reset this Namespace support object for reuse. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected java.lang.String[] fNamespace
fNamespaceSize
,
fContext
protected int fNamespaceSize
protected int[] fContext
fNamespaceSize
protected int fCurrentContext
Constructor Detail |
public NamespaceSupport()
public NamespaceSupport(NamespaceContext context)
Method Detail |
public void reset()
It is necessary to invoke this method before reusing the Namespace support object for a new session.
public void pushContext()
Normally, you should push a new context at the beginning of each XML element: the new context will automatically inherit the declarations of its parent context, but it will also keep track of which declarations were made within this context.
The Namespace support object always starts with a base context already in force: in this context, only the "xml" prefix is declared.
popContext()
public void popContext()
Normally, you should pop the context at the end of each XML element. After popping the context, all Namespace prefix mappings that were previously in force are restored.
You must not attempt to declare additional Namespace prefixes after popping a context, unless you push another context first.
pushContext()
public boolean declarePrefix(java.lang.String prefix, java.lang.String uri)
This method declares a prefix in the current Namespace context; the prefix will remain in force until this context is popped, unless it is shadowed in a descendant context.
To declare a default Namespace, use the empty string. The prefix must not be "xml" or "xmlns".
Note that you must not declare a prefix after you've pushed and popped another Namespace.
prefix
- The prefix to declare, or null for the empty
string.uri
- The Namespace URI to associate with the prefix.getURI(java.lang.String)
,
getDeclaredPrefixAt(int)
public java.lang.String getURI(java.lang.String prefix)
This method looks up the prefix in the current context. Use the empty string ("") for the default Namespace.
prefix
- The prefix to look up.getDeclaredPrefixAt(int)
public java.lang.String getPrefix(java.lang.String uri)
This method looks up the namespace URI in the current context.
uri
- The namespace URI to look up.getPrefix(java.lang.String)
public int getDeclaredPrefixCount()
public java.lang.String getDeclaredPrefixAt(int index)
public NamespaceContext getParentContext()
Note: This method may return the same NamespaceContext object reference. The caller is responsible for saving the declared prefix mappings before calling this method.
|
Documentation is available at http://download.oracle.com/docs/cd/E13222_01/wls/docs81 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |