| java.lang.Object org.dom4j.io.XMPPPacketReader
Method Summary | |
public void | addHandler(String path, ElementHandler handler) Adds the ElementHandler to be called when the
specified path is encounted. | protected Reader | createReader(InputStream in) Factory method to create a Reader from the given InputStream. | protected DispatchHandler | getDispatchHandler() | public DocumentFactory | getDocumentFactory() | public long | getLastActive() Returns the last time a full Document was read or a heartbeat was received. | public XmlPullParserFactory | getXPPFactory() | public MXParser | getXPPParser() | public Document | parseDocument(String xml) | public Document | parseDocument() | public Document | read(File file) Reads a Document from the given File
Parameters: file - is the File to read from. | public Document | read(URL url) Reads a Document from the given URL
Parameters: url - URL to read from. | public Document | read(String systemID) Reads a Document from the given URL or filename.
If the systemID contains a ':' character then it is
assumed to be a URL otherwise its assumed to be a file name.
If you want finer grained control over this mechansim then please
explicitly pass in either a
URL or a
File instance
instead of a
String to denote the source of the document.
Parameters: systemID - is a URL for a document or a file name. | public Document | read(InputStream in) Reads a Document from the given stream
Parameters: in - InputStream to read from. | public Document | read(String charSet, InputStream in) Reads a Document from the given stream
Parameters: charSet - the charSet that the input is encoded in Parameters: in - InputStream to read from. | public Document | read(Reader reader) | public Document | read(char[] text) | public Document | read(InputStream in, String systemID) | public Document | read(Reader reader, String systemID) | public void | removeHandler(String path) Removes the ElementHandler from the event based
processor, for the specified path. | public void | setDefaultHandler(ElementHandler handler) When multiple ElementHandler instances have been
registered, this will set a default ElementHandler
to be called for any path which does NOT have a handler
registered. | protected void | setDispatchHandler(DispatchHandler dispatchHandler) | public void | setDocumentFactory(DocumentFactory factory) This sets the DocumentFactory used to create new documents. | public void | setXPPFactory(XmlPullParserFactory xppFactory) |
XMPPPacketReader | public XMPPPacketReader()(Code) | | |
XMPPPacketReader | public XMPPPacketReader(DocumentFactory factory)(Code) | | |
addHandler | public void addHandler(String path, ElementHandler handler)(Code) | | Adds the ElementHandler to be called when the
specified path is encounted.
Parameters: path - is the path to be handled Parameters: handler - is the ElementHandler to be calledby the event based processor. |
getDispatchHandler | protected DispatchHandler getDispatchHandler()(Code) | | |
getDocumentFactory | public DocumentFactory getDocumentFactory()(Code) | | the DocumentFactory used to create document objects |
getLastActive | public long getLastActive()(Code) | | Returns the last time a full Document was read or a heartbeat was received. Hearbeats
are represented as whitespaces or \n received while a Document is not being parsed.
the time in milliseconds when the last document or heartbeat was received. |
getXPPFactory | public XmlPullParserFactory getXPPFactory() throws XmlPullParserException(Code) | | |
getXPPParser | public MXParser getXPPParser() throws XmlPullParserException(Code) | | |
parseDocument | public Document parseDocument(String xml) throws DocumentException(Code) | | |
parseDocument | public Document parseDocument() throws DocumentException, IOException, XmlPullParserException(Code) | | |
read | public Document read(File file) throws DocumentException, IOException, XmlPullParserException(Code) | | Reads a Document from the given File
Parameters: file - is the File to read from. the newly created Document instance throws: DocumentException - if an error occurs during parsing. throws: java.net.MalformedURLException - if a URL could not be made for the given File |
read | public Document read(URL url) throws DocumentException, IOException, XmlPullParserException(Code) | | Reads a Document from the given URL
Parameters: url - URL to read from. the newly created Document instance throws: DocumentException - if an error occurs during parsing. |
read | public Document read(String systemID) throws DocumentException, IOException, XmlPullParserException(Code) | | Reads a Document from the given URL or filename.
If the systemID contains a ':' character then it is
assumed to be a URL otherwise its assumed to be a file name.
If you want finer grained control over this mechansim then please
explicitly pass in either a
URL or a
File instance
instead of a
String to denote the source of the document.
Parameters: systemID - is a URL for a document or a file name. the newly created Document instance throws: DocumentException - if an error occurs during parsing. throws: java.net.MalformedURLException - if a URL could not be made for the given File |
read | public Document read(InputStream in) throws DocumentException, IOException, XmlPullParserException(Code) | | Reads a Document from the given stream
Parameters: in - InputStream to read from. the newly created Document instance throws: DocumentException - if an error occurs during parsing. |
read | public Document read(String charSet, InputStream in) throws DocumentException, IOException, XmlPullParserException(Code) | | Reads a Document from the given stream
Parameters: charSet - the charSet that the input is encoded in Parameters: in - InputStream to read from. the newly created Document instance throws: DocumentException - if an error occurs during parsing. |
read | public Document read(Reader reader) throws DocumentException, IOException, XmlPullParserException(Code) | | Reads a Document from the given Reader
Parameters: reader - is the reader for the input the newly created Document instance throws: DocumentException - if an error occurs during parsing. |
read | public Document read(char[] text) throws DocumentException, IOException, XmlPullParserException(Code) | | Reads a Document from the given array of characters
Parameters: text - is the text to parse the newly created Document instance throws: DocumentException - if an error occurs during parsing. |
read | public Document read(InputStream in, String systemID) throws DocumentException, IOException, XmlPullParserException(Code) | | Reads a Document from the given stream
Parameters: in - InputStream to read from. Parameters: systemID - is the URI for the input the newly created Document instance throws: DocumentException - if an error occurs during parsing. |
read | public Document read(Reader reader, String systemID) throws DocumentException, IOException, XmlPullParserException(Code) | | Reads a Document from the given Reader
Parameters: reader - is the reader for the input Parameters: systemID - is the URI for the input the newly created Document instance throws: DocumentException - if an error occurs during parsing. |
removeHandler | public void removeHandler(String path)(Code) | | Removes the ElementHandler from the event based
processor, for the specified path.
Parameters: path - is the path to remove the ElementHandler for. |
setDefaultHandler | public void setDefaultHandler(ElementHandler handler)(Code) | | When multiple ElementHandler instances have been
registered, this will set a default ElementHandler
to be called for any path which does NOT have a handler
registered.
Parameters: handler - is the ElementHandler to be calledby the event based processor. |
setDispatchHandler | protected void setDispatchHandler(DispatchHandler dispatchHandler)(Code) | | |
setDocumentFactory | public void setDocumentFactory(DocumentFactory factory)(Code) | | This sets the DocumentFactory used to create new documents.
This method allows the building of custom DOM4J tree objects to be implemented
easily using a custom derivation of
DocumentFactory
Parameters: factory - DocumentFactory used to create DOM4J objects |
setXPPFactory | public void setXPPFactory(XmlPullParserFactory xppFactory)(Code) | | |
|
|