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 DocumentBuilder
builder
Builder being proxied.private ParserPool
owningPool
Pool that owns this parser.private boolean
returned
Track 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
Modifier and Type Method Description protected void
checkValidState()
Check whether the parser is in a valid and usable state, and if not, throw a runtime exception.DOMImplementation
getDOMImplementation()
protected ParserPool
getOwningPool()
Gets the pool that owns this parser.protected DocumentBuilder
getProxiedBuilder()
Gets the proxied document builder.Schema
getSchema()
boolean
isNamespaceAware()
protected boolean
isReturned()
Check accounting state as to whether this parser has been returned to the owning pool.boolean
isValidating()
boolean
isXIncludeAware()
Document
newDocument()
Document
parse(File f)
Document
parse(InputStream is)
Document
parse(InputStream is, String systemId)
Document
parse(String uri)
Document
parse(InputSource is)
void
reset()
void
setEntityResolver(EntityResolver er)
void
setErrorHandler(ErrorHandler eh)
protected void
setReturned(boolean isReturned)
Set accounting state as to whether this parser has been returned to the owning pool.
-
Field Details
-
builder
Builder being proxied. -
owningPool
Pool that owns this parser. -
returned
private boolean returnedTrack accounting state of whether this builder has been returned to the owning pool.
-
-
Constructor Details
-
DocumentBuilderProxy
Constructor.- Parameters:
target
- document builder to proxyowner
- the owning pool
-
-
Method Details
-
getDOMImplementation
- Specified by:
getDOMImplementation
in classDocumentBuilder
-
getSchema
- Overrides:
getSchema
in classDocumentBuilder
-
isNamespaceAware
public boolean isNamespaceAware()- Specified by:
isNamespaceAware
in classDocumentBuilder
-
isValidating
public boolean isValidating()- Specified by:
isValidating
in classDocumentBuilder
-
isXIncludeAware
public boolean isXIncludeAware()- Overrides:
isXIncludeAware
in classDocumentBuilder
-
newDocument
- Specified by:
newDocument
in classDocumentBuilder
-
parse
- Overrides:
parse
in classDocumentBuilder
- Throws:
SAXException
IOException
-
parse
- Specified by:
parse
in classDocumentBuilder
- Throws:
SAXException
IOException
-
parse
- Overrides:
parse
in classDocumentBuilder
- Throws:
SAXException
IOException
-
parse
- Overrides:
parse
in classDocumentBuilder
- Throws:
SAXException
IOException
-
parse
- Overrides:
parse
in classDocumentBuilder
- Throws:
SAXException
IOException
-
reset
public void reset()- Overrides:
reset
in classDocumentBuilder
-
setEntityResolver
- Specified by:
setEntityResolver
in classDocumentBuilder
-
setErrorHandler
- Specified by:
setErrorHandler
in classDocumentBuilder
-
getOwningPool
Gets the pool that owns this parser.- Returns:
- pool that owns this parser
-
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.
-