org.opensaml.xml.parse
Interface ParserPool

All Known Implementing Classes:
BasicParserPool, StaticBasicParserPool

public interface ParserPool

A pool of XML parsers.


Method Summary
 DocumentBuilder getBuilder()
          Gets a builder from the pool.
 Schema getSchema()
          Gets the schema builders use to validate.
 Document newDocument()
          Convience method for creating a new document with a pooled builder.
 Document parse(InputStream input)
          Convience method for parsing an XML file using a pooled builder.
 Document parse(Reader input)
          Convience method for parsing an XML file using a pooled builder.
 void returnBuilder(DocumentBuilder builder)
          Returns a builder to the pool.
 void setSchema(Schema newSchema)
          Sets the schema builders use to validate.
 

Method Detail

getBuilder

DocumentBuilder getBuilder()
                           throws XMLParserException
Gets a builder from the pool.

Returns:
a builder from the pool
Throws:
XMLParserException - thrown if the document builder factory is misconfigured

returnBuilder

void returnBuilder(DocumentBuilder builder)
Returns a builder to the pool.

Parameters:
builder - the builder to return

newDocument

Document newDocument()
                     throws XMLParserException
Convience method for creating a new document with a pooled builder.

Returns:
created document
Throws:
XMLParserException - thrown if there is a problem retrieving a builder

parse

Document parse(InputStream input)
               throws XMLParserException
Convience method for parsing an XML file using a pooled builder.

Parameters:
input - XML to parse
Returns:
parsed document
Throws:
XMLParserException - thrown if there is a problem retrieving a builder, the input stream can not be read, or the XML was invalid

parse

Document parse(Reader input)
               throws XMLParserException
Convience method for parsing an XML file using a pooled builder.

Parameters:
input - XML to parse
Returns:
parsed document
Throws:
XMLParserException - thrown if there is a problem retrieving a builder, the input stream can not be read, or the XML was invalid

getSchema

Schema getSchema()
Gets the schema builders use to validate.

Returns:
the schema builders use to validate

setSchema

void setSchema(Schema newSchema)
Sets the schema builders use to validate.

Parameters:
newSchema - the schema builders use to validate


Copyright © 2006-2011 Internet2. All Rights Reserved.