public interface ParserPool
Modifier and Type | Method and Description |
---|---|
DocumentBuilder |
getBuilder()
Gets a builder from the pool.
|
Document |
newDocument()
Convenience method for creating a new document with a pooled builder.
|
Document |
parse(InputStream input)
Convenience method for parsing an XML file using a pooled builder.
|
Document |
parse(Reader input)
Convenience method for parsing an XML file using a pooled builder.
|
void |
returnBuilder(DocumentBuilder builder)
Returns a builder to the pool.
|
@Nonnull DocumentBuilder getBuilder() throws XMLParserException
XMLParserException
- thrown if the document builder factory is misconfiguredvoid returnBuilder(@Nullable DocumentBuilder builder)
builder
- the builder to return@Nonnull Document newDocument() throws XMLParserException
XMLParserException
- thrown if there is a problem retrieving a builder@Nonnull Document parse(@Nonnull InputStream input) throws XMLParserException
input
- XML to parseXMLParserException
- thrown if there is a problem retrieving a builder, the input stream can not be read,
or the XML was invalid@Nonnull Document parse(@Nonnull Reader input) throws XMLParserException
input
- XML to parseXMLParserException
- thrown if there is a problem retrieving a builder, the input stream can not be read,
or the XML was invalidCopyright © 1999–2017. All rights reserved.