|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.xml.QXmlNamespaceSupport
public class QXmlNamespaceSupport
The QXmlNamespaceSupport class is a helper class for XML readers which want to include namespace support.
You can set the prefix for the current namespace with setPrefix, and get the list of current prefixes (or those for a given URI) with prefixes. The namespace URI is available from uri. Use pushContext to start a new namespace context, and popContext to return to the previous namespace context. Use splitName() or processName() to split a name into its prefix and local name.
Support via Features
Nested Class Summary | |
---|---|
static class |
QXmlNamespaceSupport.ProcessedName
|
static class |
QXmlNamespaceSupport.SplitName
|
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I> |
Constructor Summary | |
---|---|
QXmlNamespaceSupport()
Constructs a QXmlNamespaceSupport. |
Method Summary | |
---|---|
static QXmlNamespaceSupport |
fromNativePointer(QNativePointer nativePointer)
This function returns the QXmlNamespaceSupport instance pointed to by nativePointer |
static QNativePointer |
nativePointerArray(QXmlNamespaceSupport[] array)
This function returns a QNativePointer that is pointing to the specified QXmlNamespaceSupport array. |
void |
popContext()
Reverts to the previous namespace context. |
java.lang.String |
prefix(java.lang.String arg__1)
Returns one of the prefixes mapped to the namespace URI arg__1. |
java.util.List<java.lang.String> |
prefixes()
Returns a list of all the prefixes currently declared. |
java.util.List<java.lang.String> |
prefixes(java.lang.String arg__1)
Returns a list of all prefixes currently declared for the namespace URI arg__1. |
QXmlNamespaceSupport.ProcessedName |
processName(java.lang.String qname,
boolean isAttribute)
Processes a raw XML 1.0 name in the current context by removing the prefix and looking it up among the prefixes currently declared. |
void |
pushContext()
Starts a new namespace context. |
void |
reset()
Resets this namespace support object ready for reuse. |
void |
setPrefix(java.lang.String arg__1,
java.lang.String arg__2)
This function declares a prefix arg__1 in the current namespace context to be the namespace URI arg__2. |
QXmlNamespaceSupport.SplitName |
splitName(java.lang.String qname)
Splits the name qname at the '.' and returns the prefix prefix and the local name. |
java.lang.String |
uri(java.lang.String arg__1)
Looks up the prefix arg__1 in the current context and returns the currently-mapped namespace URI. |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Constructor Detail |
---|
public QXmlNamespaceSupport()
Constructs a QXmlNamespaceSupport.
Method Detail |
---|
public final void popContext()
Reverts to the previous namespace context.
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.
public final java.lang.String prefix(java.lang.String arg__1)
Returns one of the prefixes mapped to the namespace URI arg__1.
If more than one prefix is currently mapped to the same URI, this function makes an arbitrary selection; if you want all of the prefixes, use prefixes instead.
Note: to check for a default prefix, use the uri function with an argument of "".
public final java.util.List<java.lang.String> prefixes(java.lang.String arg__1)
Returns a list of all prefixes currently declared for the namespace URI arg__1.
The "xml:" prefix is included. If you only want one prefix that is mapped to the namespace URI, and you don't care which one you get, use the prefix function instead.
Note: The empty (default) prefix is never included in this list; to check for the presence of a default namespace, call uri with "" as the argument.
public final java.util.List<java.lang.String> prefixes()
Returns a list of all the prefixes currently declared.
If there is a default prefix, this function does not return it in the list; check for the default prefix using uri with an argument of "".
public final void pushContext()
Starts a new namespace context.
Normally, you should push a new context at the beginning of each XML element: the new context automatically inherits the declarations of its parent context, and it also keeps track of which declarations were made within this context.
public final void reset()
Resets this namespace support object ready for reuse.
public final void setPrefix(java.lang.String arg__1, java.lang.String arg__2)
This function declares a prefix arg__1 in the current namespace context to be the namespace URI arg__2. The prefix remains in force until this context is popped, unless it is shadowed in a descendant context.
Note that there is an asymmetry in this library. prefix does not return the default "" prefix, even if you have declared one; to check for a default prefix, you must look it up explicitly using uri. This asymmetry exists to make it easier to look up prefixes for attribute names, where the default prefix is not allowed.
public final java.lang.String uri(java.lang.String arg__1)
Looks up the prefix arg__1 in the current context and returns the currently-mapped namespace URI. Use the empty string ("") for the default namespace.
public static QXmlNamespaceSupport fromNativePointer(QNativePointer nativePointer)
nativePointer
- the QNativePointer of which object should be returned.public static QNativePointer nativePointerArray(QXmlNamespaceSupport[] array)
array
- the array that the returned pointer will point to.
public QXmlNamespaceSupport.ProcessedName processName(java.lang.String qname, boolean isAttribute)
qname is the raw XML 1.0 name to be processed. isAttribute is true if the name is an attribute name.
Note that attribute names are processed differently than element names: an unprefixed element name gets the default namespace (if any), while an unprefixed attribute name does not.
public QXmlNamespaceSupport.SplitName splitName(java.lang.String qname)
|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |