Class BasicParserPool.DocumentBuilderProxy
- java.lang.Object
-
- javax.xml.parsers.DocumentBuilder
-
- net.shibboleth.utilities.java.support.xml.BasicParserPool.DocumentBuilderProxy
-
- Enclosing class:
- BasicParserPool
protected class BasicParserPool.DocumentBuilderProxy extends DocumentBuilder
A proxy that prevents the manages document builders retrieved from the parser pool.
-
-
Field Summary
Fields Modifier and Type Field Description private DocumentBuilderbuilderBuilder being proxied.private ParserPoolowningPoolPool that owns this parser.private booleanreturnedTrack accounting state of whether this builder has been returned to the owning pool.
-
Constructor Summary
Constructors Constructor Description DocumentBuilderProxy(DocumentBuilder target, BasicParserPool owner)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckValidState()Check whether the parser is in a valid and usable state, and if not, throw a runtime exception.DOMImplementationgetDOMImplementation()protected ParserPoolgetOwningPool()Gets the pool that owns this parser.protected DocumentBuildergetProxiedBuilder()Gets the proxied document builder.SchemagetSchema()booleanisNamespaceAware()protected booleanisReturned()Check accounting state as to whether this parser has been returned to the owning pool.booleanisValidating()booleanisXIncludeAware()DocumentnewDocument()Documentparse(File f)Documentparse(InputStream is)Documentparse(InputStream is, String systemId)Documentparse(String uri)Documentparse(InputSource is)voidreset()voidsetEntityResolver(EntityResolver er)voidsetErrorHandler(ErrorHandler eh)protected voidsetReturned(boolean isReturned)Set accounting state as to whether this parser has been returned to the owning pool.
-
-
-
Field Detail
-
builder
private final DocumentBuilder builder
Builder being proxied.
-
owningPool
private final ParserPool owningPool
Pool that owns this parser.
-
returned
private boolean returned
Track accounting state of whether this builder has been returned to the owning pool.
-
-
Constructor Detail
-
DocumentBuilderProxy
public DocumentBuilderProxy(DocumentBuilder target, BasicParserPool owner)
Constructor.- Parameters:
target- document builder to proxyowner- the owning pool
-
-
Method Detail
-
getDOMImplementation
public DOMImplementation getDOMImplementation()
- Specified by:
getDOMImplementationin classDocumentBuilder
-
getSchema
public Schema getSchema()
- Overrides:
getSchemain classDocumentBuilder
-
isNamespaceAware
public boolean isNamespaceAware()
- Specified by:
isNamespaceAwarein classDocumentBuilder
-
isValidating
public boolean isValidating()
- Specified by:
isValidatingin classDocumentBuilder
-
isXIncludeAware
public boolean isXIncludeAware()
- Overrides:
isXIncludeAwarein classDocumentBuilder
-
newDocument
public Document newDocument()
- Specified by:
newDocumentin classDocumentBuilder
-
parse
public Document parse(File f) throws SAXException, IOException
- Overrides:
parsein classDocumentBuilder- Throws:
SAXExceptionIOException
-
parse
public Document parse(InputSource is) throws SAXException, IOException
- Specified by:
parsein classDocumentBuilder- Throws:
SAXExceptionIOException
-
parse
public Document parse(InputStream is) throws SAXException, IOException
- Overrides:
parsein classDocumentBuilder- Throws:
SAXExceptionIOException
-
parse
public Document parse(InputStream is, String systemId) throws SAXException, IOException
- Overrides:
parsein classDocumentBuilder- Throws:
SAXExceptionIOException
-
parse
public Document parse(String uri) throws SAXException, IOException
- Overrides:
parsein classDocumentBuilder- Throws:
SAXExceptionIOException
-
reset
public void reset()
- Overrides:
resetin classDocumentBuilder
-
setEntityResolver
public void setEntityResolver(EntityResolver er)
- Specified by:
setEntityResolverin classDocumentBuilder
-
setErrorHandler
public void setErrorHandler(ErrorHandler eh)
- Specified by:
setErrorHandlerin classDocumentBuilder
-
getOwningPool
protected ParserPool getOwningPool()
Gets the pool that owns this parser.- Returns:
- pool that owns this parser
-
getProxiedBuilder
protected DocumentBuilder getProxiedBuilder()
Gets the proxied document builder.- Returns:
- proxied document builder
-
isReturned
protected boolean isReturned()
Check accounting state as to whether this parser has been returned to the owning pool.- Returns:
- true if parser has been returned to the owning pool, otherwise false
-
setReturned
protected void setReturned(boolean isReturned)
Set accounting state as to whether this parser has been returned to the owning pool.- Parameters:
isReturned- set true to indicate that parser has been returned to the owning pool
-
checkValidState
protected void checkValidState()
Check whether the parser is in a valid and usable state, and if not, throw a runtime exception.
-
-