public class NamespaceContextImpl extends Object implements NamespaceContext2
| Constructor and Description |
|---|
NamespaceContextImpl()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
String |
declareNamespace(String namespaceUri,
boolean requirePrefix)
Deprecated.
Declares a new namespace binding within the current context.
|
void |
endElement()
Deprecated.
Ends the current element context and gets back to the parent context.
|
String |
getNamespaceURI(String prefix)
Deprecated.
Obtains the namespace URI currently associated to the given prefix.
|
String |
getPrefix(String namespaceUri)
Deprecated.
|
Iterator |
getPrefixes(String namespaceUri)
Deprecated.
|
void |
iterateDeclaredPrefixes(PrefixCallback callback)
Deprecated.
Iterates all newly declared namespace prefixes for this element.
|
void |
startElement()
Deprecated.
Sets the current bindings aside and starts a new element context.
|
public String declareNamespace(String namespaceUri, boolean requirePrefix)
NamespaceContext2The prefix is automatically assigned by MarshallingContext. If a given namespace URI is already declared, nothing happens.
It is NOT an error to declare the same namespace URI more than once.
For marshalling to work correctly, all namespace bindings for an element must be declared between its startElement method and its endAttributes event. Calling the same method with the same parameter between the endAttributes and the endElement returns the same prefix.
declareNamespace in interface NamespaceContext2requirePrefix - If this parameter is true, this method must assign a prefix
to this namespace, even if it's already bound to the default
namespace. IOW, this method will never return null if this
flag is true. This functionality is necessary to declare
namespace URI used for attribute names.public String getPrefix(String namespaceUri)
getPrefix in interface NamespaceContextpublic String getNamespaceURI(String prefix)
getNamespaceURI in interface NamespaceContextpublic Iterator getPrefixes(String namespaceUri)
getPrefixes in interface NamespaceContextpublic void startElement()
public void endElement()
public void iterateDeclaredPrefixes(PrefixCallback callback) throws SAXException
SAXExceptionCopyright © 2015 Oracle Corporation. All Rights Reserved.