|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.legstar.dom.DocumentFactory
public final class DocumentFactory
Builds a DOM document from an input stream.
Uses a new document builder with any useful attributes. This is not thread safe.
Method Summary | |
---|---|
static Document |
create()
Creates a new, empty, DOM document. |
protected static com.legstar.dom.DocumentFactory.ParsingErrorHandler |
initBuilder()
Creates a builder if it is not there and associate an error handler. |
static Document |
parse(File file)
Parse an input file and return a new DOM document. |
static Document |
parse(InputStream in)
Parse an input stream and return a new DOM document. |
static Document |
parse(String xml)
Parse an input string and return a new DOM document. |
static Document |
parse(URI uri)
Parse an input URI and return a new DOM document. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Document create() throws Exception
Exception
- if creation failspublic static Document parse(InputStream in) throws InvalidDocumentException
in
- the input stream
InvalidDocumentException
- if parsing failedpublic static Document parse(URI uri) throws InvalidDocumentException
uri
- the input URI (relative or absolute)
InvalidDocumentException
- if parsing failedprotected static com.legstar.dom.DocumentFactory.ParsingErrorHandler initBuilder() throws InvalidDocumentException
InvalidDocumentException
- if initialization failspublic static Document parse(File file) throws InvalidDocumentException
file
- the input file
InvalidDocumentException
- if parsing failedpublic static Document parse(String xml) throws InvalidDocumentException
file
- the input file
InvalidDocumentException
- if parsing failed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |