Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.trolltech.qt.xml
Class QXmlReader

    java.lang.Object
      com.trolltech.qt.internal.QSignalEmitterInternal
          com.trolltech.qt.QSignalEmitter
              com.trolltech.qt.QtJambiObject
                  com.trolltech.qt.xml.QXmlReader

All Implemented Interfaces:
  QtJambiInterface

Direct Known Subclasses:
  QXmlSimpleReader

    public abstract class QXmlReader

extends QtJambiObject

The `QXmlReader` class provides an interface for XML readers (i.e. parsers). This abstract class provides an interface for all of Qt's XML readers. Currently there is only one implementation of a reader included in Qt's XML module: `QXmlSimpleReader`. In future releases there might be more readers with different properties available (e.g. a validating parser).

The design of the XML classes follows the SAX2 Java interface, with the names adapted to fit Qt naming conventions. It should be very easy for anybody who has worked with SAX2 to get started with the Qt XML classes.

All readers use the class `QXmlInputSource` to read the input document. Since you are normally interested in particular content in the XML document, the reader reports the content through special handler classes (`QXmlDTDHandler`, `QXmlDeclHandler`, `QXmlContentHandler`, `QXmlEntityResolver`, `QXmlErrorHandler` and `QXmlLexicalHandler`), which you must subclass, if you want to process the contents.

Since the handler classes only describe interfaces you must implement all the functions. We provide the `QXmlDefaultHandler` class to make this easier: it implements a default behavior (do nothing) for all functions, so you can subclass it and just implement the functions you are interested in.

Features and properties of the reader can be set with `setFeature()` and setProperty() respectively. You can set the reader to use your own subclasses with `setEntityResolver()`, `setDTDHandler()`, `setContentHandler()`, `setErrorHandler()`, `setLexicalHandler()` and `setDeclHandler()`. The parse itself is started with a call to `parse()`.

See also:
  `QXmlSimpleReader`.

Nested Class Summary

Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter
`QSignalEmitter.AbstractSignal, 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
`QXmlReader()` Creates a new QXmlReader.

Method Summary
`abstract QXmlContentHandlerInterface` | `contentHandler()` Returns the content handler or 0 if none was set.
`abstract QXmlDeclHandlerInterface` | `declHandler()` Returns the declaration handler or 0 if none was set.
`abstract QXmlDTDHandlerInterface` | `DTDHandler()` Returns the DTD handler or 0 if none was set.
`abstract QXmlEntityResolverInterface` | `entityResolver()` Returns the entity resolver or 0 if none was set.
`abstract QXmlErrorHandlerInterface` | `errorHandler()` Returns the error handler or 0 if none is set.
`abstract boolean` | `feature(java.lang.String name)` If the reader has the feature called `name`, the feature's value is returned.
`abstract boolean` | `hasFeature(java.lang.String name)` Returns `true` if the reader has the feature called `name`; otherwise returns false.
`abstract boolean` | `hasProperty(java.lang.String name)` Returns true if the reader has the property `name`; otherwise returns false.
`abstract QXmlLexicalHandlerInterface` | `lexicalHandler()` Returns the lexical handler or 0 if none was set.
`abstract boolean` | `parse(QXmlInputSource input)` Parses the given `input`.
`abstract void` | `setContentHandler(QXmlContentHandlerInterface handler)` Sets the content handler to `handler`.
`abstract void` | `setDeclHandler(QXmlDeclHandlerInterface handler)` Sets the declaration handler to `handler`.
`abstract void` | `setDTDHandler(QXmlDTDHandlerInterface handler)` Sets the DTD handler to `handler`.
`abstract void` | `setEntityResolver(QXmlEntityResolverInterface handler)` Sets the entity resolver to `handler`.
`abstract void` | `setErrorHandler(QXmlErrorHandlerInterface handler)` Sets the error handler to `handler`.
`abstract void` | `setFeature(java.lang.String name, boolean value)` Sets the feature called `name` to the given `value`.
`abstract void` | `setLexicalHandler(QXmlLexicalHandlerInterface handler)` Sets the lexical handler to `handler`.

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
`clone, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface com.trolltech.qt.QtJambiInterface
`disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership`

Constructor Detail

### QXmlReader

    public QXmlReader()

  Creates a new QXmlReader.

Method Detail

### DTDHandler

    public abstract QXmlDTDHandlerInterface DTDHandler()

  Returns the DTD handler or 0 if none was set.

See also:
  `setDTDHandler()`.

### contentHandler

    public abstract QXmlContentHandlerInterface contentHandler()

  Returns the content handler or 0 if none was set.

See also:
  `setContentHandler()`.

### declHandler

    public abstract QXmlDeclHandlerInterface declHandler()

  Returns the declaration handler or 0 if none was set.

See also:
  `setDeclHandler()`.

### entityResolver

    public abstract QXmlEntityResolverInterface entityResolver()

  Returns the entity resolver or 0 if none was set.

See also:
  `setEntityResolver()`.

### errorHandler

    public abstract QXmlErrorHandlerInterface errorHandler()

  Returns the error handler or 0 if none is set.

See also:
  `setErrorHandler()`.

### feature

    public abstract boolean feature(java.lang.String name)

  If the reader has the feature called `name`, the feature's value is returned. If no such feature exists the return value is undefined.

  If `ok` is not 0: `*``ok` is set to true if the reader has the feature called `name`; otherwise `*``ok` is set to false.

See also:
  `setFeature()`, and `hasFeature()`.

### hasFeature

    public abstract boolean hasFeature(java.lang.String name)

  Returns `true` if the reader has the feature called `name`; otherwise returns false.

See also:
  `feature()`, and `setFeature()`.

### hasProperty

    public abstract boolean hasProperty(java.lang.String name)

  Returns true if the reader has the property `name`; otherwise returns false.

See also:
  property(), and setProperty().

### lexicalHandler

    public abstract QXmlLexicalHandlerInterface lexicalHandler()

  Returns the lexical handler or 0 if none was set.

See also:
  `setLexicalHandler()`.

### parse

    public abstract boolean parse(QXmlInputSource input)

  Parses the given `input`.

### setContentHandler

    public abstract void setContentHandler(QXmlContentHandlerInterface handler)

  Sets the content handler to `handler`.

See also:
  `contentHandler()`.

### setDTDHandler

    public abstract void setDTDHandler(QXmlDTDHandlerInterface handler)

  Sets the DTD handler to `handler`.

See also:
  `DTDHandler()`.

### setDeclHandler

    public abstract void setDeclHandler(QXmlDeclHandlerInterface handler)

  Sets the declaration handler to `handler`.

See also:
  `declHandler()`.

### setEntityResolver

    public abstract void setEntityResolver(QXmlEntityResolverInterface handler)

  Sets the entity resolver to `handler`.

See also:
  `entityResolver()`.

### setErrorHandler

    public abstract void setErrorHandler(QXmlErrorHandlerInterface handler)

  Sets the error handler to `handler`. Clears the error handler if `handler` is 0.

See also:
  `errorHandler()`.

### setFeature

    public abstract void setFeature(java.lang.String name,
                                    boolean value)

  Sets the feature called `name` to the given `value`. If the reader doesn't have the feature nothing happens.

See also:
  `feature()`, and `hasFeature()`.

### setLexicalHandler

    public abstract void setLexicalHandler(QXmlLexicalHandlerInterface handler)

  Sets the lexical handler to `handler`.

See also:
  `lexicalHandler()`.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD