|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.nierbeck.timeTrack.model.impl.runtime.NamespaceContextImpl
public class NamespaceContextImpl
Implementation of the NamespaceContext2. This class also provides several utility methods for XMLSerializer-derived classes. The startElement method and the endElement method need to be called appropriately when used. See javadoc for those methods for details.
Constructor Summary | |
---|---|
NamespaceContextImpl(com.sun.xml.bind.marshaller.NamespacePrefixMapper _prefixMapper)
|
Method Summary | |
---|---|
java.lang.String |
declareNamespace(java.lang.String namespaceUri,
java.lang.String preferedPrefix,
boolean requirePrefix)
Declares a new namespace binding within the current context. |
void |
endElement()
Ends the current element context and gets back to the parent context. |
void |
endNamespaceDecls()
Reconciles the namespace URI/prefix mapping requests since the last startElement method invocation and finalizes them. |
com.sun.xml.bind.marshaller.NamespacePrefixMapper |
getNamespacePrefixMapper()
|
java.lang.String |
getNamespaceURI(java.lang.String prefix)
Obtains the namespace URI currently associated to the given prefix. |
java.lang.String |
getPrefix(java.lang.String namespaceUri)
|
java.util.Iterator |
getPrefixes(java.lang.String namespaceUri)
|
void |
iterateDeclaredPrefixes(PrefixCallback callback)
Iterates all newly declared namespace prefixes for this element. |
void |
startElement()
Sets the current bindings aside and starts a new element context. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NamespaceContextImpl(com.sun.xml.bind.marshaller.NamespacePrefixMapper _prefixMapper)
Method Detail |
---|
public final com.sun.xml.bind.marshaller.NamespacePrefixMapper getNamespacePrefixMapper()
public java.lang.String declareNamespace(java.lang.String namespaceUri, java.lang.String preferedPrefix, boolean requirePrefix)
NamespaceContext2
The 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 NamespaceContext2
requirePrefix
- true if this is called for attribute name. false otherwise.preferedPrefix
- If the caller has any particular preference to the prefix,
pass that as a parameter. The callee will try to honor it. Set
null if there's no particular preference.
public java.lang.String getPrefix(java.lang.String namespaceUri)
getPrefix
in interface javax.xml.namespace.NamespaceContext
public java.lang.String getNamespaceURI(java.lang.String prefix)
getNamespaceURI
in interface javax.xml.namespace.NamespaceContext
public java.util.Iterator getPrefixes(java.lang.String namespaceUri)
getPrefixes
in interface javax.xml.namespace.NamespaceContext
public void startElement()
public void endNamespaceDecls()
public void endElement()
public void iterateDeclaredPrefixes(PrefixCallback callback) throws org.xml.sax.SAXException
org.xml.sax.SAXException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |