use of org.xml.sax.InputSource in project XobotOS by xamarin.
the class SAXParser method parse.
/**
* <p>Parse the content of the given {@link java.io.InputStream}
* instance as XML using the specified {@link org.xml.sax.HandlerBase}.
* <i> Use of the DefaultHandler version of this method is recommended as
* the HandlerBase class has been deprecated in SAX 2.0</i>.</p>
*
* @param is InputStream containing the content to be parsed.
* @param hb The SAX HandlerBase to use.
* @param systemId The systemId which is needed for resolving relative URIs.
*
* @throws IllegalArgumentException If the given <code>InputStream</code> is
* <code>null</code>.
* @throws IOException If any IO error occurs interacting with the
* <code>InputStream</code>.
* @throws SAXException If any SAX errors occur during processing.
*
* @see org.xml.sax.DocumentHandler version of this method instead.
*/
public void parse(InputStream is, HandlerBase hb, String systemId) throws SAXException, IOException {
if (is == null) {
throw new IllegalArgumentException("InputStream cannot be null");
}
InputSource input = new InputSource(is);
input.setSystemId(systemId);
this.parse(input, hb);
}
use of org.xml.sax.InputSource in project XobotOS by xamarin.
the class SAXParser method parse.
/**
* Parse the content of the given {@link java.io.InputStream}
* instance as XML using the specified
* {@link org.xml.sax.helpers.DefaultHandler}.
*
* @param is InputStream containing the content to be parsed.
* @param dh The SAX DefaultHandler to use.
*
* @throws IllegalArgumentException If the given InputStream is null.
* @throws IOException If any IO errors occur.
* @throws SAXException If any SAX errors occur during processing.
*
* @see org.xml.sax.DocumentHandler
*/
public void parse(InputStream is, DefaultHandler dh) throws SAXException, IOException {
if (is == null) {
throw new IllegalArgumentException("InputStream cannot be null");
}
InputSource input = new InputSource(is);
this.parse(input, dh);
}
use of org.xml.sax.InputSource in project XobotOS by xamarin.
the class SAXParser method parse.
/**
* Parse the content of the file specified as XML using the
* specified {@link org.xml.sax.helpers.DefaultHandler}.
*
* @param f The file containing the XML to parse
* @param dh The SAX DefaultHandler to use.
*
* @throws IllegalArgumentException If the File object is null.
* @throws IOException If any IO errors occur.
* @throws SAXException If any SAX errors occur during processing.
*
* @see org.xml.sax.DocumentHandler
*/
public void parse(File f, DefaultHandler dh) throws SAXException, IOException {
if (f == null) {
throw new IllegalArgumentException("File cannot be null");
}
String escapedURI = FilePathToURI.filepath2URI(f.getAbsolutePath());
if (DEBUG) {
System.out.println("Escaped URI = " + escapedURI);
}
InputSource input = new InputSource(escapedURI);
this.parse(input, dh);
}
use of org.xml.sax.InputSource in project XobotOS by xamarin.
the class SAXParser method parse.
/**
* <p>Parse the content of the given {@link java.io.InputStream}
* instance as XML using the specified {@link org.xml.sax.HandlerBase}.
* <i> Use of the DefaultHandler version of this method is recommended as
* the HandlerBase class has been deprecated in SAX 2.0</i>.</p>
*
* @param is InputStream containing the content to be parsed.
* @param hb The SAX HandlerBase to use.
*
* @throws IllegalArgumentException If the given InputStream is null.
* @throws SAXException If parse produces a SAX error.
* @throws IOException If an IO error occurs interacting with the
* <code>InputStream</code>.
*
* @see org.xml.sax.DocumentHandler
*/
public void parse(InputStream is, HandlerBase hb) throws SAXException, IOException {
if (is == null) {
throw new IllegalArgumentException("InputStream cannot be null");
}
InputSource input = new InputSource(is);
this.parse(input, hb);
}
use of org.xml.sax.InputSource in project XobotOS by xamarin.
the class SAXParser method parse.
/**
* Parse the content described by the giving Uniform Resource
* Identifier (URI) as XML using the specified
* {@link org.xml.sax.HandlerBase}.
* <i> Use of the DefaultHandler version of this method is recommended as
* the <code>HandlerBase</code> class has been deprecated in SAX 2.0</i>
*
* @param uri The location of the content to be parsed.
* @param hb The SAX HandlerBase to use.
*
* @throws IllegalArgumentException If the uri is null.
* @throws IOException If any IO errors occur.
* @throws SAXException If any SAX errors occur during processing.
*
* @see org.xml.sax.DocumentHandler
*/
public void parse(String uri, HandlerBase hb) throws SAXException, IOException {
if (uri == null) {
throw new IllegalArgumentException("uri cannot be null");
}
InputSource input = new InputSource(uri);
this.parse(input, hb);
}
Aggregations