public abstract class DOMParser extends Object
createPoolingParser()
and createNonPoolingParser()
.
For fast creation of empty xml documents, or for in memory creation of DOM documents use the
createEmptyDocument()
method.Constructor and Description |
---|
DOMParser() |
Modifier and Type | Method and Description |
---|---|
protected static DocumentBuilder |
createDocumentBuilder(DOMParserOptions parseroptions)
Creates a new DocumentBuilder with the given attributes.
|
static Document |
createEmptyDocument() |
static Document |
createEmptyDocument(DOMParserOptions options) |
static DOMParser |
createNew()
Creates a new DOMParser.
|
static DOMParser |
createNew(DOMParserOptions options)
Creates a new DOMParser.
|
static DOMParser |
createNonPoolingParser()
Creates a non pooling Parser, with default options.
|
static DOMParser |
createNonPoolingParser(DOMParserOptions options)
Creates a non pooling Parser, with the given options.
|
static DOMParser |
createPoolingParser()
Creates a pooling Parser with default options and using the global DocumentBuilder pool.
|
static DOMParser |
createPoolingParser(DOMParserOptions options)
Creates a pooling Parser with the given options, using the global DocumentBuilder pool.
|
static DOMParser |
createPoolingParser(DOMParserOptions options,
DocumentBuilderPool pool)
Creates a pooling Parser with the given options, which uses the given document builder pool.
|
static EntityResolver |
getDefaultEntityResolver()
By default this method creates a
ClasspathEntityResolver in quite mode, which means the parsing will
never fail because of non existing entities (e.g. |
static DocumentBuilderPool |
getDocumentBuilderPool()
Gets the documentBuilderPool used by pooled parsers.
|
Document |
parse(InputSource inputSource)
Parses the inputsource.
|
Document |
parse(InputSource inputSource,
ErrorHandler errorhandler)
Parses the inputsource and informs the error handler about errors.
|
abstract Document |
parse(InputSource source,
ErrorHandler errorhandler,
EntityResolver entityResolver)
Parses the inputsource using the errorhandler and entityresolver.
|
static void |
setDefaultEntityResolver(EntityResolver defaultresolver)
Sets the defaultEntityResolver.
|
static void |
setDocumentBuilderPool(DocumentBuilderPool builderPool)
Sets the documentBuilderPool.
|
public static EntityResolver getDefaultEntityResolver()
ClasspathEntityResolver
in quite mode, which means the parsing will
never fail because of non existing entities (e.g. dtd's).public static void setDefaultEntityResolver(EntityResolver defaultresolver)
public static DocumentBuilderPool getDocumentBuilderPool()
public static void setDocumentBuilderPool(DocumentBuilderPool builderPool)
builderPool
- the documentBuilderPool.protected static DocumentBuilder createDocumentBuilder(DOMParserOptions parseroptions)
parseroptions
- options for the new parser.public static Document createEmptyDocument()
public static Document createEmptyDocument(DOMParserOptions options)
public static DOMParser createNew()
public static DOMParser createNew(DOMParserOptions options)
options
- the options.public static DOMParser createNonPoolingParser()
public static DOMParser createNonPoolingParser(DOMParserOptions options)
options
- the options.public static DOMParser createPoolingParser()
public static DOMParser createPoolingParser(DOMParserOptions options)
options
- the options.public static DOMParser createPoolingParser(DOMParserOptions options, DocumentBuilderPool pool)
public Document parse(InputSource inputSource, ErrorHandler errorhandler) throws DOMParserException
DOMParserException
- if an SAXException or IOException occurs.public abstract Document parse(InputSource source, ErrorHandler errorhandler, EntityResolver entityResolver) throws DOMParserException
DOMParserException
- if an SAXException or IOException occurs.public Document parse(InputSource inputSource) throws DOMParserException
DOMParserException
- if an SAXException or IOException occurs.Copyright © 2004–2016 52north.org. All rights reserved.