|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--schwing.util.XMLUtil
Contains helper methods for working with XML.
Method Summary | |
static org.w3c.dom.Document |
createDocument()
Creates an instance of Document . |
static org.w3c.dom.Document |
createDocument(java.lang.String tag)
Creates an instance of Document with the supplied root
tag. |
static org.xml.sax.EntityResolver |
getEntityResolver(java.io.InputStream istream)
Creates an instance of EntityResolver using the
supplied InputStream . |
static org.w3c.dom.Document |
loadDocument(java.io.InputStream istream)
Loads the specified document from the supplied InputStream . |
static org.w3c.dom.Document |
loadDocument(java.io.InputStream istream,
org.xml.sax.EntityResolver resolver)
Loads the specified document from the supplied InputStream . |
static org.w3c.dom.Document |
loadDocument(java.io.InputStream istream,
org.xml.sax.EntityResolver resolver,
org.xml.sax.ErrorHandler ehandler)
Loads the specified document from the supplied InputStream . |
static org.w3c.dom.Document |
loadDocument(java.io.InputStream istream,
org.xml.sax.EntityResolver resolver,
org.xml.sax.ErrorHandler ehandler,
java.lang.Object[][] features)
Loads the specified document from the supplied InputStream . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static org.xml.sax.EntityResolver getEntityResolver(java.io.InputStream istream)
Creates an instance of EntityResolver
using the
supplied InputStream
. The InputStream
will
contain the actual DTD file.
istream
- the input streamnull
if the operation failedpublic static org.w3c.dom.Document createDocument()
Creates an instance of Document
.
public static org.w3c.dom.Document createDocument(java.lang.String tag)
Creates an instance of Document
with the supplied root
tag.
tag
- the root tag namepublic static org.w3c.dom.Document loadDocument(java.io.InputStream istream) throws org.xml.sax.SAXException, java.io.IOException
Loads the specified document from the supplied InputStream
.
istream
- the input streamorg.xml.sax.SAXException
- if a parsing error occursjava.io.IOException
- if an I/O error occurspublic static org.w3c.dom.Document loadDocument(java.io.InputStream istream, org.xml.sax.EntityResolver resolver) throws org.xml.sax.SAXException, java.io.IOException
Loads the specified document from the supplied InputStream
.
The supplied EntityResolver
is used to validate the content
as it is parsed.
istream
- the input streamresolver
- the DTDorg.xml.sax.SAXException
- if a parsing error occursjava.io.IOException
- if an I/O error occurspublic static org.w3c.dom.Document loadDocument(java.io.InputStream istream, org.xml.sax.EntityResolver resolver, org.xml.sax.ErrorHandler ehandler) throws org.xml.sax.SAXException, java.io.IOException
Loads the specified document from the supplied InputStream
.
The supplied EntityResolver
is used to validate the content
as it is parsed. When content-related errors are found, the supplied instance of
ErrorHandler
is notified.
istream
- the input streamresolver
- the DTDorg.xml.sax.SAXException
- if a parsing error occursjava.io.IOException
- if an I/O error occurspublic static org.w3c.dom.Document loadDocument(java.io.InputStream istream, org.xml.sax.EntityResolver resolver, org.xml.sax.ErrorHandler ehandler, java.lang.Object[][] features) throws org.xml.sax.SAXException, java.io.IOException
Loads the specified document from the supplied InputStream
.
The supplied EntityResolver
is used to validate the content
as it is parsed. When content-related errors are found, the supplied instance of
ErrorHandler
is notified. The supplied list of features are
used to set the specified parser features for loading the document.
In this implementation, the supplied list of features is expected to be
an array of 2-element Object
arrays, where element 0 is a
String
for the feature, and element 1 is a
java.lang.Boolean
setting the state for the feature. For example:
Object[][] features = { {"feature1",Boolean.TRUE}, {"feature2",Boolean.FALSE}, };
istream
- the input streamresolver
- the DTDehandler
- the error handling objectfeatures
- the parser featuresorg.xml.sax.SAXException
- if a parsing error occursjava.io.IOException
- if an I/O error occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |