/** * <p> * Reads a Document from the given stream * </p> * * @param in * <code>InputStream</code> to read from. * * @return the newly created Document instance * * @throws DocumentException * if an error occurs during parsing. * @throws IOException * DOCUMENT ME! * @throws XmlPullParserException * DOCUMENT ME! */ public Document read(InputStream in) throws DocumentException, IOException, XmlPullParserException { return read(createReader(in)); }
/** * When multiple <code>ElementHandler</code> instances have been * registered, this will set a default <code>ElementHandler</code> to be * called for any path which does <b>NOT </b> have a handler registered. * * @param handler * is the <code>ElementHandler</code> to be called by the event * based processor. */ public void setDefaultHandler(ElementHandler handler) { getDispatchHandler().setDefaultHandler(handler); }
public XmlPullParser getXPPParser() throws XmlPullParserException { if (xppParser == null) { xppParser = getXPPFactory().newPullParser(); } return xppParser; }
/** * <p> * Reads a Document from the given array of characters * </p> * * @param text * is the text to parse * * @return the newly created Document instance * * @throws DocumentException * if an error occurs during parsing. * @throws IOException * DOCUMENT ME! * @throws XmlPullParserException * DOCUMENT ME! */ public Document read(char[] text) throws DocumentException, IOException, XmlPullParserException { getXPPParser().setInput(text); return parseDocument(); }
protected Document parseDocument() throws DocumentException, IOException, XmlPullParserException { Document document = getDocumentFactory().createDocument(); Element parent = null; XmlPullParser parser = getXPPParser(); parser.setNamespaceAware(true);
/** * <p> * Reads a Document from the given <code>File</code> * </p> * * @param file * is the <code>File</code> to read from. * * @return the newly created Document instance * * @throws DocumentException * if an error occurs during parsing. * @throws IOException * if a URL could not be made for the given File * @throws XmlPullParserException * DOCUMENT ME! */ public Document read(File file) throws DocumentException, IOException, XmlPullParserException { String systemID = file.getAbsolutePath(); return read(new BufferedReader(new FileReader(file)), systemID); }
/** * <p> * Reads a Document from the given <code>Reader</code> * </p> * * @param reader * is the reader for the input * * @return the newly created Document instance * * @throws DocumentException * if an error occurs during parsing. * @throws IOException * DOCUMENT ME! * @throws XmlPullParserException * DOCUMENT ME! */ public Document read(Reader reader) throws DocumentException, IOException, XmlPullParserException { getXPPParser().setInput(reader); return parseDocument(); }
protected Document parseDocument() throws DocumentException, IOException, XmlPullParserException { Document document = getDocumentFactory().createDocument(); Element parent = null; XmlPullParser parser = getXPPParser(); parser.setNamespaceAware(true);
/** * <p> * Reads a Document from the given stream * </p> * * @param in * <code>InputStream</code> to read from. * @param systemID * is the URI for the input * * @return the newly created Document instance * * @throws DocumentException * if an error occurs during parsing. * @throws IOException * DOCUMENT ME! * @throws XmlPullParserException * DOCUMENT ME! */ public Document read(InputStream in, String systemID) throws DocumentException, IOException, XmlPullParserException { return read(createReader(in), systemID); }
/** * <p> * Reads a Document from the given array of characters * </p> * * @param text * is the text to parse * * @return the newly created Document instance * * @throws DocumentException * if an error occurs during parsing. * @throws IOException * DOCUMENT ME! * @throws XmlPullParserException * DOCUMENT ME! */ public Document read(char[] text) throws DocumentException, IOException, XmlPullParserException { getXPPParser().setInput(text); return parseDocument(); }
protected Document parseDocument() throws DocumentException, IOException, XmlPullParserException { Document document = getDocumentFactory().createDocument(); Element parent = null; XmlPullParser parser = getXPPParser(); parser.setNamespaceAware(true);
/** * Removes the <code>ElementHandler</code> from the event based processor, * for the specified path. * * @param path * is the path to remove the <code>ElementHandler</code> for. */ public void removeHandler(String path) { getDispatchHandler().removeHandler(path); }
/** * <p> * Reads a Document from the given <code>Reader</code> * </p> * * @param reader * is the reader for the input * @param systemID * is the URI for the input * * @return the newly created Document instance * * @throws DocumentException * if an error occurs during parsing. * @throws IOException * DOCUMENT ME! * @throws XmlPullParserException * DOCUMENT ME! */ public Document read(Reader reader, String systemID) throws DocumentException, IOException, XmlPullParserException { Document document = read(reader); document.setName(systemID); return document; }
public XmlPullParser getXPPParser() throws XmlPullParserException { if (xppParser == null) { xppParser = getXPPFactory().newPullParser(); } return xppParser; }
/** * <p> * Reads a Document from the given <code>URL</code> * </p> * * @param url * <code>URL</code> to read from. * * @return the newly created Document instance * * @throws DocumentException * if an error occurs during parsing. * @throws IOException * DOCUMENT ME! * @throws XmlPullParserException * DOCUMENT ME! */ public Document read(URL url) throws DocumentException, IOException, XmlPullParserException { String systemID = url.toExternalForm(); return read(createReader(url.openStream()), systemID); }
/** * <p> * Reads a Document from the given <code>Reader</code> * </p> * * @param reader * is the reader for the input * * @return the newly created Document instance * * @throws DocumentException * if an error occurs during parsing. * @throws IOException * DOCUMENT ME! * @throws XmlPullParserException * DOCUMENT ME! */ public Document read(Reader reader) throws DocumentException, IOException, XmlPullParserException { getXPPParser().setInput(reader); return parseDocument(); }
protected Document parseDocument() throws DocumentException, IOException, XmlPullParserException { Document document = getDocumentFactory().createDocument(); Element parent = null; XmlPullParser parser = getXPPParser(); parser.setNamespaceAware(true);
/** * Adds the <code>ElementHandler</code> to be called when the specified * path is encounted. * * @param path * is the path to be handled * @param handler * is the <code>ElementHandler</code> to be called by the event * based processor. */ public void addHandler(String path, ElementHandler handler) { getDispatchHandler().addHandler(path, handler); }
/** * <p> * Reads a Document from the given <code>File</code> * </p> * * @param file * is the <code>File</code> to read from. * * @return the newly created Document instance * * @throws DocumentException * if an error occurs during parsing. * @throws IOException * if a URL could not be made for the given File * @throws XmlPullParserException * DOCUMENT ME! */ public Document read(File file) throws DocumentException, IOException, XmlPullParserException { String systemID = file.getAbsolutePath(); return read(new BufferedReader(new FileReader(file)), systemID); }