|
|||||||||
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.QXmlReader
public abstract class QXmlReader
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()
.
QXmlSimpleReader
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9 |
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. |
static QXmlReader |
fromNativePointer(QNativePointer nativePointer)
|
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 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 |
---|
public QXmlReader()
Method Detail |
---|
public abstract QXmlDTDHandlerInterface DTDHandler()
setDTDHandler()
.
public abstract QXmlContentHandlerInterface contentHandler()
setContentHandler()
.
public abstract QXmlDeclHandlerInterface declHandler()
setDeclHandler()
.
public abstract QXmlEntityResolverInterface entityResolver()
setEntityResolver()
.
public abstract QXmlErrorHandlerInterface errorHandler()
setErrorHandler()
.
public abstract boolean feature(java.lang.String name)
If ok is not 0: *ok is set to true if the reader has the feature called name; otherwise *ok is set to false.
setFeature()
, and hasFeature()
.
public abstract boolean hasFeature(java.lang.String name)
feature()
, and setFeature()
.
public abstract boolean hasProperty(java.lang.String name)
public abstract QXmlLexicalHandlerInterface lexicalHandler()
setLexicalHandler()
.
public abstract boolean parse(QXmlInputSource input)
public abstract void setContentHandler(QXmlContentHandlerInterface handler)
contentHandler()
.
public abstract void setDTDHandler(QXmlDTDHandlerInterface handler)
DTDHandler()
.
public abstract void setDeclHandler(QXmlDeclHandlerInterface handler)
declHandler()
.
public abstract void setEntityResolver(QXmlEntityResolverInterface handler)
entityResolver()
.
public abstract void setErrorHandler(QXmlErrorHandlerInterface handler)
errorHandler()
.
public abstract void setFeature(java.lang.String name, boolean value)
feature()
, and hasFeature()
.
public abstract void setLexicalHandler(QXmlLexicalHandlerInterface handler)
lexicalHandler()
.
public static QXmlReader fromNativePointer(QNativePointer nativePointer)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |