Top Description Methods
org.jdom2.input.sax

public Interface SAXEngine

Known Direct Implementers
org.jdom2.input.SAXBuilder, org.jdom2.input.sax.SAXBuilderEngine
Imports
java.io.File, .IOException, .InputStream, .Reader, java.net.URL, org.xml.sax.DTDHandler, .EntityResolver, .ErrorHandler, .InputSource, org.jdom2.Document, .JDOMException, .JDOMFactory

SAXEngine provides an interface to interact with either the SAXBuilder or the SAXBuilderEngine. This makes it possible to do pooling of SAXEngines for parsing using instances of either SAXBuilder or SAXBuilderEngine.
Author
Rolf Lear
See Also
org.jdom2.input.sax

Method Summary

Modifier and TypeMethod and Description
public Document

Returns:

Document resultant Document object
build
(InputSource
InputSource to read from
in
)

This builds a document from the supplied input source.

public Document

Returns:

Document resultant Document object
build
(InputStream
InputStream to read from
in
)

This builds a document from the supplied input stream.

public Document

Returns:

Document resultant Document object
build
(final File
File to read from
file
)

This builds a document from the supplied filename.

public Document

Returns:

Document - resultant Document object.
build
(final URL
URL to read from.
url
)

This builds a document from the supplied URL.

public Document

Returns:

Document resultant Document object
build
(final InputStream
InputStream to read from.
in
,
final String
base for resolving relative URIs
systemId
)

This builds a document from the supplied input stream.

public Document

Returns:

Document resultant Document object
build
(final Reader
Reader to read from
characterStream
)

This builds a document from the supplied Reader.

public Document

Returns:

Document resultant Document object
build
(final Reader
Reader to read from.
characterStream
,
final String
base for resolving relative URIs
systemId
)

This builds a document from the supplied Reader.

public Document

Returns:

Document resultant Document object
build
(final String
URI for the input
systemId
)

This builds a document from the supplied URI.

public DTDHandler

Returns:

the DTDHandler assigned
getDTDHandler
()

Returns the DTDHandler assigned, or null if none.

public EntityResolver

Returns:

the EntityResolver assigned
getEntityResolver
()

Returns the EntityResolver assigned, or null if none.

public ErrorHandler

Returns:

the ErrorHandler assigned, or null if none
getErrorHandler
()

Returns the ErrorHandler assigned, or null if none.

public boolean

Returns:

whether entities are being expanded
getExpandEntities
()

Returns whether or not entities are being expanded into normal text content.

public boolean

Returns:

boolean - whether only whitespace content will be ignored during build.
getIgnoringBoundaryWhitespace
()

Returns whether or not the parser will eliminate element content containing only whitespace.

public boolean

Returns:

whether element content whitespace is to be ignored during the build
getIgnoringElementContentWhitespace
()

Returns whether element content whitespace is to be ignored during the build.

public JDOMFactory

Returns:

the factory in use
getJDOMFactory
()

Returns the current org.jdom2.JDOMFactory in use.

public boolean

Returns:

whether validation is to be performed during the build
isValidating
()

Returns whether validation is to be performed during the build.

Method Detail

buildback to summary
public Document build(InputSource in) throws JDOMException, IOException

This builds a document from the supplied input source.

Parameters
in:InputSource

InputSource to read from

Returns:Document

Document resultant Document object

Exceptions
JDOMException:
when errors occur in parsing
IOException:
when an I/O error prevents a document from being fully parsed
buildback to summary
public Document build(InputStream in) throws JDOMException, IOException

This builds a document from the supplied input stream.

Parameters
in:InputStream

InputStream to read from

Returns:Document

Document resultant Document object

Exceptions
JDOMException:
when errors occur in parsing
IOException:
when an I/O error prevents a document from being fully parsed.
buildback to summary
public Document build(final File file) throws JDOMException, IOException

This builds a document from the supplied filename.

Parameters
file:File

File to read from

Returns:Document

Document resultant Document object

Exceptions
JDOMException:
when errors occur in parsing
IOException:
when an I/O error prevents a document from being fully parsed
buildback to summary
public Document build(final URL url) throws JDOMException, IOException

This builds a document from the supplied URL.

Parameters
url:URL

URL to read from.

Returns:Document

Document - resultant Document object.

Exceptions
JDOMException:
when errors occur in parsing
IOException:
when an I/O error prevents a document from being fully parsed.
buildback to summary
public Document build(final InputStream in, final String systemId) throws JDOMException, IOException

This builds a document from the supplied input stream.

Parameters
in:InputStream

InputStream to read from.

systemId:String

base for resolving relative URIs

Returns:Document

Document resultant Document object

Exceptions
JDOMException:
when errors occur in parsing
IOException:
when an I/O error prevents a document from being fully parsed
buildback to summary
public Document build(final Reader characterStream) throws JDOMException, IOException

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.

Parameters
characterStream:Reader

Reader to read from

Returns:Document

Document resultant Document object

Exceptions
JDOMException:
when errors occur in parsing
IOException:
when an I/O error prevents a document from being fully parsed
buildback to summary
public Document build(final Reader characterStream, final String systemId) throws JDOMException, IOException

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.

Parameters
characterStream:Reader

Reader to read from.

systemId:String

base for resolving relative URIs

Returns:Document

Document resultant Document object

Exceptions
JDOMException:
when errors occur in parsing
IOException:
when an I/O error prevents a document from being fully parsed
buildback to summary
public Document build(final String systemId) throws JDOMException, IOException

This builds a document from the supplied URI.

Parameters
systemId:String

URI for the input

Returns:Document

Document resultant Document object

Exceptions
JDOMException:
when errors occur in parsing
IOException:
when an I/O error prevents a document from being fully parsed
getDTDHandlerback to summary
public DTDHandler getDTDHandler()

Returns the DTDHandler assigned, or null if none.

Returns:DTDHandler

the DTDHandler assigned

getEntityResolverback to summary
public EntityResolver getEntityResolver()

Returns the EntityResolver assigned, or null if none.

Returns:EntityResolver

the EntityResolver assigned

getErrorHandlerback to summary
public ErrorHandler getErrorHandler()

Returns the ErrorHandler assigned, or null if none.

Returns:ErrorHandler

the ErrorHandler assigned, or null if none

getExpandEntitiesback to summary
public boolean getExpandEntities()

Returns whether or not entities are being expanded into normal text content.

Returns:boolean

whether entities are being expanded

getIgnoringBoundaryWhitespaceback to summary
public boolean getIgnoringBoundaryWhitespace()

Returns whether or not the parser will eliminate element content containing only whitespace.

Returns:boolean

boolean - whether only whitespace content will be ignored during build.

getIgnoringElementContentWhitespaceback to summary
public boolean getIgnoringElementContentWhitespace()

Returns whether element content whitespace is to be ignored during the build.

Returns:boolean

whether element content whitespace is to be ignored during the build

getJDOMFactoryback to summary
public JDOMFactory getJDOMFactory()

Returns the current org.jdom2.JDOMFactory in use.

Returns:JDOMFactory

the factory in use

isValidatingback to summary
public boolean isValidating()

Returns whether validation is to be performed during the build.

Returns:boolean

whether validation is to be performed during the build