com.trolltech.qt.xml
Class QXmlStreamAttributes

java.lang.Object
  extended by com.trolltech.qt.internal.QSignalEmitterInternal
      extended by com.trolltech.qt.QSignalEmitter
          extended by com.trolltech.qt.QtJambiObject
              extended by com.trolltech.qt.xml.QXmlStreamAttributes
All Implemented Interfaces:
QtJambiInterface, java.lang.Cloneable

public class QXmlStreamAttributes
extends QtJambiObject
implements java.lang.Cloneable

The QXmlStreamAttributes class represents a vector of QXmlStreamAttribute. Attributes are returned by a QXmlStreamReader in attributes() when the reader reports a start element . The class can also be used with a QXmlStreamWriter as an argument to writeAttributes().

The convenience function value() loops over the vector and returns an attribute value for a given namespaceUri and an attribute's name.

New attributes can be added with append().


Nested Class Summary
 
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter
QSignalEmitter.AbstractSignal, QSignalEmitter.PrivateSignal0, QSignalEmitter.PrivateSignal1, QSignalEmitter.PrivateSignal2, QSignalEmitter.PrivateSignal3, QSignalEmitter.PrivateSignal4, QSignalEmitter.PrivateSignal5, QSignalEmitter.PrivateSignal6, QSignalEmitter.PrivateSignal7, QSignalEmitter.PrivateSignal8, QSignalEmitter.PrivateSignal9, QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9
 
Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal
 
Field Summary
 
Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
currentSender
 
Constructor Summary
QXmlStreamAttributes()
          Creates a new QXmlStreamAttributes object.
 
Method Summary
 void append(QXmlStreamAttribute attribute)
          Appends attribute to this QXmlStreamAttributes.
 void append(java.lang.String qualifiedName, java.lang.String value)
          This is an overloaded member function, provided for convenience.
 void append(java.lang.String namespaceUri, java.lang.String name, java.lang.String value)
          Appends a new attribute with name in the namespace described with namespaceUri, and value value.
 QXmlStreamAttribute at(int i)
           
 int capacity()
           
 void clear()
           
 QXmlStreamAttributes clone()
          This method is reimplemented for internal reasons
 boolean contains(QXmlStreamAttribute t)
           
 int count()
           
 int count(QXmlStreamAttribute t)
           
 boolean empty()
           
 boolean endsWith(QXmlStreamAttribute t)
           
 java.util.List fill(QXmlStreamAttribute t)
           
 java.util.List fill(QXmlStreamAttribute t, int size)
           
 QXmlStreamAttribute first()
          
static java.util.List fromList(java.util.List list)
           
 boolean hasAttribute(java.lang.String qualifiedName)
          Returns true if this QXmlStreamAttributes has an attribute whose qualified name is qualifiedName; otherwise returns false.
 boolean hasAttribute(java.lang.String namespaceUri, java.lang.String name)
          This is an overloaded member function, provided for convenience.
 int indexOf(QXmlStreamAttribute t)
           
 int indexOf(QXmlStreamAttribute t, int from)
           
 boolean isEmpty()
           
 QXmlStreamAttribute last()
          
 int lastIndexOf(QXmlStreamAttribute t)
           
 int lastIndexOf(QXmlStreamAttribute t, int from)
           
 java.util.List mid(int pos)
           
 java.util.List mid(int pos, int length)
           
 void prepend(QXmlStreamAttribute t)
           
 void remove(int i)
           
 void remove(int i, int n)
           
 void replace(int i, QXmlStreamAttribute t)
           
 void reserve(int size)
           
 void resize(int size)
           
 void setSharable(boolean sharable)
           
 int size()
           
 void squeeze()
           
 boolean startsWith(QXmlStreamAttribute t)
           
 java.util.List toList()
           
 java.lang.String value(java.lang.String qualifiedName)
          This is an overloaded member function, provided for convenience.
 java.lang.String value(java.lang.String namespaceUri, java.lang.String name)
          Returns the value of the attribute name in the namespace described with namespaceUri, or an empty string reference if the attribute is not defined.
 
Methods inherited from class com.trolltech.qt.QtJambiObject
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr
 
Methods inherited from class com.trolltech.qt.QSignalEmitter
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread
 
Methods inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
__qt_signalInitialization
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.trolltech.qt.QtJambiInterface
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership
 

Constructor Detail

QXmlStreamAttributes

public QXmlStreamAttributes()
Creates a new QXmlStreamAttributes object.

Method Detail

append

public final void append(java.lang.String namespaceUri,
                         java.lang.String name,
                         java.lang.String value)
Appends a new attribute with name in the namespace described with namespaceUri, and value value. The namespaceUri can be empty.


append

public final void append(java.lang.String qualifiedName,
                         java.lang.String value)
This is an overloaded member function, provided for convenience.

Appends a new attribute with qualified name qualifiedName and value value.


append

public final void append(QXmlStreamAttribute attribute)
Appends attribute to this QXmlStreamAttributes.


at

public final QXmlStreamAttribute at(int i)

capacity

public final int capacity()

clear

public final void clear()

contains

public final boolean contains(QXmlStreamAttribute t)

count

public final int count()

count

public final int count(QXmlStreamAttribute t)

empty

public final boolean empty()

endsWith

public final boolean endsWith(QXmlStreamAttribute t)

fill

public final java.util.List fill(QXmlStreamAttribute t)

fill

public final java.util.List fill(QXmlStreamAttribute t,
                                 int size)

first

public final QXmlStreamAttribute first()


hasAttribute

public final boolean hasAttribute(java.lang.String namespaceUri,
                                  java.lang.String name)
This is an overloaded member function, provided for convenience.

Returns true if this QXmlStreamAttributes has an attribute whose namespace URI and name correspond to namespaceUri and name; otherwise returns false.


hasAttribute

public final boolean hasAttribute(java.lang.String qualifiedName)
Returns true if this QXmlStreamAttributes has an attribute whose qualified name is qualifiedName; otherwise returns false.

Note that this is not namespace aware. For instance, if this QXmlStreamAttributes contains an attribute whose lexical name is "xlink:href" this doesn't tell that an attribute named href in the XLink namespace is present, since the xlink prefix can be bound to any namespace. Use the overload that takes a namespace URI and a local name as parameter, for namespace aware code.


indexOf

public final int indexOf(QXmlStreamAttribute t)

indexOf

public final int indexOf(QXmlStreamAttribute t,
                         int from)

isEmpty

public final boolean isEmpty()

last

public final QXmlStreamAttribute last()


lastIndexOf

public final int lastIndexOf(QXmlStreamAttribute t)

lastIndexOf

public final int lastIndexOf(QXmlStreamAttribute t,
                             int from)

mid

public final java.util.List mid(int pos)

mid

public final java.util.List mid(int pos,
                                int length)

prepend

public final void prepend(QXmlStreamAttribute t)

remove

public final void remove(int i)

remove

public final void remove(int i,
                         int n)

replace

public final void replace(int i,
                          QXmlStreamAttribute t)

reserve

public final void reserve(int size)

resize

public final void resize(int size)

setSharable

public final void setSharable(boolean sharable)

size

public final int size()

squeeze

public final void squeeze()

startsWith

public final boolean startsWith(QXmlStreamAttribute t)

toList

public final java.util.List toList()

value

public final java.lang.String value(java.lang.String namespaceUri,
                                    java.lang.String name)
Returns the value of the attribute name in the namespace described with namespaceUri, or an empty string reference if the attribute is not defined. The namespaceUri can be empty.


value

public final java.lang.String value(java.lang.String qualifiedName)
This is an overloaded member function, provided for convenience.

Returns the value of the attribute with qualified name qualifiedName , or an empty string reference if the attribute is not defined. A qualified name is the raw name of an attribute in the XML data. It consists of the namespace prefix, followed by colon, followed by the attribute's local name. Since the namespace prefix is not unique (the same prefix can point to different namespaces and different prefixes can point to the same namespace), you shouldn't use qualified names, but a resolved namespaceUri and the attribute's local name.


fromList

public static java.util.List fromList(java.util.List list)

clone

public QXmlStreamAttributes clone()
This method is reimplemented for internal reasons

Overrides:
clone in class java.lang.Object