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, wrapgetEventAllocator, getProperty, getXMLReporter, getXMLResolver, isPropertySupported, setEventAllocator, setProperty, setXMLReporter, setXMLResolvernewFactory, newFactory, newInstance, newInstancepublic UnclosedReaderDetector(javax.xml.stream.XMLInputFactory parent)
parent - the parent factoryprotected javax.xml.stream.XMLStreamReader wrap(javax.xml.stream.XMLStreamReader reader)
WrappingXMLInputFactoryXMLStreamReader instances created from the factory. The default
implementation simply returns the unwrapped reader.wrap in class WrappingXMLInputFactoryreader - the reader to wrapCopyright © The Apache Software Foundation. All Rights Reserved.