org.xml.sax.InputSource instance using a SAX parser. This Engine is
built by the SAXBuilder based on the state of the SAXBuilder when the engine
was produced. It is not possible to reconfigure the engine once built, but it
can be reused many times (though not concurrently). This makes it the fastest
way to process many multitudes of XML documents (if those documents are all
parsed the same way). If you want to process in multiple threads you can
safely have one SAXBuilderEngine in each thread on the condition that:
XMLReaderJDOMFactory that it supplies a new
instance of an XMLReader on each call (the JDOM-supplied ones all do).
SAXHandlerFactory that it supplies a new
instance of a SAXHanfler on each call (the JDOM-supplied one does)
org.jdom2.input.sax
| Modifier and Type | Field and Description |
|---|---|
| private final SAXHandler | saxHandler
The SAXHandler |
| private final XMLReader | saxParser
The SAX XMLReader. |
| private final boolean | validating
indicates whether this is a validating parser |
| Access | Constructor and Description |
|---|---|
| public | SAXBuilderEngine(final XMLReader
The XMLReader this Engine parses with reader, final SAXHandler The SAXHandler that processes the SAX Events. handler, final boolean True if this is a validating system. validating)Creates a new SAXBuilderEngine. |
| Modifier and Type | Method and Description |
|---|---|
| public Document | build(final InputSource
InputSource to read fromImplements org. |
| public Document | build(final InputStream
InputStream to read fromImplements org. This builds a document from the supplied input stream. |
| public Document | build(final File
File to read fromImplements org. This builds a document from the supplied filename. |
| public Document | build(final URL
URL to read from.Implements org. This builds a document from the supplied URL. |
| public Document | build(final InputStream
InputStream to read from.base for resolving relative URIs systemId)Implements org. This builds a document from the supplied input stream. |
| public Document | build(final Reader
Reader to read fromImplements org. This builds a document from the supplied Reader. |
| public Document | build(final Reader
Reader to read from.base for resolving relative URIs systemId)Implements org. This builds a document from the supplied Reader. |
| public Document | build(final String
URI for the input systemId)Implements org. This builds a document from the supplied URI. |
| private static URL | |
| public DTDHandler | getDTDHandler()
Implements org. DTDHandler assigned, or null if none.
|
| public EntityResolver | getEntityResolver()
Implements org. EntityResolver assigned, or null if none.
|
| public ErrorHandler | getErrorHandler()
Implements org. ErrorHandler assigned, or null if none.
|
| public boolean | getExpandEntities()
Implements org. |
| public boolean | getIgnoringBoundaryWhitespace()
Implements org. |
| public boolean | getIgnoringElementContentWhitespace()
Implements org. |
| public JDOMFactory | getJDOMFactory()
Implements org. org. in use.
|
| public boolean | isValidating()
Implements org. |
| saxHandler | back to summary |
|---|---|
| private final SAXHandler saxHandler The SAXHandler | |
| saxParser | back to summary |
|---|---|
| private final XMLReader saxParser The SAX XMLReader. | |
| validating | back to summary |
|---|---|
| private final boolean validating indicates whether this is a validating parser | |
| SAXBuilderEngine | back to summary |
|---|---|
| public SAXBuilderEngine(final XMLReader reader, final SAXHandler handler, final boolean validating) Creates a new SAXBuilderEngine.
| |
| build | back to summary |
|---|---|
| public Document build(final InputSource in) throws JDOMException, IOException Implements org. Doc from org. This builds a document from the supplied input source.
| |
| build | back to summary |
|---|---|
| public Document build(final InputStream in) throws JDOMException, IOException Implements org. Doc from org. This builds a document from the supplied input stream.
| |
| build | back to summary |
|---|---|
| public Document build(final File file) throws JDOMException, IOException Implements org. Doc from org. This builds a document from the supplied filename.
| |
| build | back to summary |
|---|---|
| public Document build(final URL url) throws JDOMException, IOException Implements org. Doc from org. This builds a document from the supplied URL.
| |
| build | back to summary |
|---|---|
| public Document build(final InputStream in, final String systemId) throws JDOMException, IOException Implements org. Doc from org. This builds a document from the supplied input stream.
| |
| build | back to summary |
|---|---|
| public Document build(final Reader characterStream) throws JDOMException, IOException Implements org. Doc from org. This builds a document from the supplied Reader. It's the programmer's responsibility to make sure the reader matches the encoding of the file. It's often easier and safer to use an InputStream rather than a Reader, and to let the parser auto-detect the encoding from the XML declaration.
| |
| build | back to summary |
|---|---|
| public Document build(final Reader characterStream, final String systemId) throws JDOMException, IOException Implements org. Doc from org. This builds a document from the supplied Reader. It's the programmer's responsibility to make sure the reader matches the encoding of the file. It's often easier and safer to use an InputStream rather than a Reader, and to let the parser auto-detect the encoding from the XML declaration.
| |
| build | back to summary |
|---|---|
| public Document build(final String systemId) throws JDOMException, IOException Implements org. Doc from org. This builds a document from the supplied URI.
| |
| fileToURL | back to summary |
|---|---|
| private static URL fileToURL(final File file) throws MalformedURLException Custom File.toUrl() implementation to handle special chars in file names Actually, we can now rely on the core Java toURI function,
| |
| getDTDHandler | back to summary |
|---|---|
| public DTDHandler getDTDHandler() Implements org. Doc from org. Returns the
| |
| getEntityResolver | back to summary |
|---|---|
| public EntityResolver getEntityResolver() Implements org. Doc from org. Returns the
| |
| getErrorHandler | back to summary |
|---|---|
| public ErrorHandler getErrorHandler() Implements org. Doc from org. Returns the
| |
| getExpandEntities | back to summary |
|---|---|
| public boolean getExpandEntities() Implements org. Doc from org. Returns whether or not entities are being expanded into normal text content.
| |
| getIgnoringBoundaryWhitespace | back to summary |
|---|---|
| public boolean getIgnoringBoundaryWhitespace() Implements org. Doc from org. Returns whether or not the parser will eliminate element content containing only whitespace.
| |
| getIgnoringElementContentWhitespace | back to summary |
|---|---|
| public boolean getIgnoringElementContentWhitespace() Implements org. Doc from org. Returns whether element content whitespace is to be ignored during the build.
| |
| getJDOMFactory | back to summary |
|---|---|
| public JDOMFactory getJDOMFactory() Implements org. Doc from org. Returns the current
| |
| isValidating | back to summary |
|---|---|
| public boolean isValidating() Implements org. Doc from org. Returns whether validation is to be performed during the build.
| |