public class UnclosedReaderDetector extends WrappingXMLInputFactory
XMLInputFactory
wrapper that enabled detection of unclosed stream readers. An unclosed
reader will be detected when the XMLStreamReader
instance is finalized by the virtual
machine. When this happens, a warning message will be logged. The log message contains the stack
trace of the instruction that created the reader.
Note that for this to work, the detector must compute the stack trace every time a reader is created. Since this may have a significant performance impact, the wrapper should only used during testing and debugging.
ALLOCATOR, IS_COALESCING, IS_NAMESPACE_AWARE, IS_REPLACING_ENTITY_REFERENCES, IS_SUPPORTING_EXTERNAL_ENTITIES, IS_VALIDATING, REPORTER, RESOLVER, SUPPORT_DTD
Constructor and Description |
---|
UnclosedReaderDetector(javax.xml.stream.XMLInputFactory parent)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected javax.xml.stream.XMLStreamReader |
wrap(javax.xml.stream.XMLStreamReader reader)
Wrap a reader created from this factory.
|
createFilteredReader, createFilteredReader, createXMLEventReader, createXMLEventReader, createXMLEventReader, createXMLEventReader, createXMLEventReader, createXMLEventReader, createXMLEventReader, createXMLStreamReader, createXMLStreamReader, createXMLStreamReader, createXMLStreamReader, createXMLStreamReader, createXMLStreamReader, wrap
getEventAllocator, getProperty, getXMLReporter, getXMLResolver, isPropertySupported, setEventAllocator, setProperty, setXMLReporter, setXMLResolver
newFactory, newFactory, newInstance, newInstance
public UnclosedReaderDetector(javax.xml.stream.XMLInputFactory parent)
parent
- the parent factoryprotected javax.xml.stream.XMLStreamReader wrap(javax.xml.stream.XMLStreamReader reader)
WrappingXMLInputFactory
XMLStreamReader
instances created from the factory. The default
implementation simply returns the unwrapped reader.wrap
in class WrappingXMLInputFactory
reader
- the reader to wrapCopyright © 2004-2013 The Apache Software Foundation. All Rights Reserved.