|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.n52.security.common.xml.DOMParser
public abstract class DOMParser
Class DOMParser encapsulates the common usage of the DocumentBuilder class within a this helpfull DOMParser class.
At first it is designed for performance, such as you can discover a pooling DomParser, what is recommended. Only in very few situations you need a non pooling DOMParser. To simple use simple use the DOMParser.createNew() method, than you use the best performance. At next the DOMParser class uses a ClasspathEntityResolver, which ensures that the wrapped DocumentBuilder can always parse an XMLFile, and entities are only discovered within the classpath. The DOMParser class uses the factory method pattern, there with you can create DOMParsers by using the static methoddscreatePoolingParser()
and createNonPoolingParser()
.
For fast creation of empty xml documents, or for in memory creation of DOM documents use the
createEmptyDocument()
method.
Constructor Summary | |
---|---|
DOMParser()
|
Method Summary | |
---|---|
protected static javax.xml.parsers.DocumentBuilder |
createDocumentBuilder(DOMParserOptions parseroptions)
Method creates a new DocumentBuilder with the given attributes. |
static org.w3c.dom.Document |
createEmptyDocument()
Method creates an empty Document. |
static org.w3c.dom.Document |
createEmptyDocument(DOMParserOptions options)
Method creates an empty Document for the given options. |
static DOMParser |
createNew()
Method creates a new DOMParser. |
static DOMParser |
createNew(DOMParserOptions options)
Method creates a new DOMParser. |
static DOMParser |
createNonPoolingParser()
Method creates a non pooling Parser, with default options. |
static DOMParser |
createNonPoolingParser(DOMParserOptions options)
Method creates a non pooling Parser, with the given options. |
static DOMParser |
createPoolingParser()
Method creates a pooling Parser with default options and using the global DocumentBuilder pool. |
static DOMParser |
createPoolingParser(DOMParserOptions options)
Method creates a pooling Parser with the given options, using the global DocumentBuilder pool. |
static DOMParser |
createPoolingParser(DOMParserOptions options,
DocumentBuilderPool pool)
Method creates a pooling Parser with the given options, which uses the given document builder pool. |
static org.xml.sax.EntityResolver |
getDefaultEntityResolver()
Method gets the defaultEntityResolver. |
org.w3c.dom.Document |
parse(org.xml.sax.InputSource inputSource)
Method parses the inputsource. |
org.w3c.dom.Document |
parse(org.xml.sax.InputSource inputSource,
org.xml.sax.ErrorHandler errorhandler)
Method parses the inputsource and informs the error handler about errors. |
abstract org.w3c.dom.Document |
parse(org.xml.sax.InputSource source,
org.xml.sax.ErrorHandler errorhandler,
org.xml.sax.EntityResolver entityResolver)
Method parses the inputsource using the errorhandler and entityresolver. |
static void |
setDefaultEntityResolver(org.xml.sax.EntityResolver defaultresolver)
Method sets the defaultEntityResolver. |
static void |
setDocumentBuilderPool(DocumentBuilderPool builderPool)
Method sets the documentBuilderPool. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DOMParser()
Method Detail |
---|
public static org.xml.sax.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(org.xml.sax.EntityResolver defaultresolver)
defaultresolver
- the defaultEntityResolver.public static void setDocumentBuilderPool(DocumentBuilderPool builderPool)
builderPool
- the documentBuilderPool.protected static javax.xml.parsers.DocumentBuilder createDocumentBuilder(DOMParserOptions parseroptions)
parseroptions
- options for the new parser.
public static org.w3c.dom.Document createEmptyDocument()
public static org.w3c.dom.Document createEmptyDocument(DOMParserOptions options)
options
- the 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)
options
- the options.pool
- the document builder pool.
public org.w3c.dom.Document parse(org.xml.sax.InputSource inputSource, org.xml.sax.ErrorHandler errorhandler) throws DOMParserException
inputSource
- the inputSource.errorhandler
- the errorhandler.
DOMParserException
- if an SAXException or IOException occurs.public abstract org.w3c.dom.Document parse(org.xml.sax.InputSource source, org.xml.sax.ErrorHandler errorhandler, org.xml.sax.EntityResolver entityResolver) throws DOMParserException
source
- the source.errorhandler
- the errorhandler.entityResolver
- the entityResolver.
DOMParserException
- if an SAXException or IOException occurs.public org.w3c.dom.Document parse(org.xml.sax.InputSource inputSource) throws DOMParserException
inputSource
- the inputSource.
DOMParserException
- if an SAXException or IOException occurs.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |