lux.xml
Class OffsetDocBuilder
java.lang.Object
lux.xml.SaxonDocBuilder
lux.xml.OffsetDocBuilder
- All Implemented Interfaces:
- StAXHandler
public class OffsetDocBuilder
- extends SaxonDocBuilder
Holds an Offsets object that will accumulate offset information about a
document as it is parsed. Note that the Offsets is reused for subsequent parses.
Its contents will be overwritten when a document is read.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OffsetDocBuilder
public OffsetDocBuilder(net.sf.saxon.s9api.Processor processor)
throws net.sf.saxon.s9api.SaxonApiException
- Parameters:
processor - a Saxon processor.
- Throws:
net.sf.saxon.s9api.SaxonApiException
reset
public void reset()
- Description copied from interface:
StAXHandler
- reinitialize any internal state and prepare the handler for re-use
- Specified by:
reset in interface StAXHandler- Overrides:
reset in class SaxonDocBuilder
handleEvent
public void handleEvent(XMLStreamReader reader,
int eventType)
throws XMLStreamException
- Description copied from interface:
StAXHandler
- This method receives StAX events. It should never call XMLStreamReader.next()
since if it does, its caller will miss the event.
- Specified by:
handleEvent in interface StAXHandler- Overrides:
handleEvent in class SaxonDocBuilder
- Parameters:
reader - the reader from which events are being readeventType - the XML stream event type
- Throws:
XMLStreamException
getOffsets
public Offsets getOffsets()
- Overrides:
getOffsets in class SaxonDocBuilder
- Returns:
- the offsets accumulated for the parsed document. This object is only valid
after a document has been parsed, and in any case may be null if it setOffsets(null) was
called.
isFixupCRLF
public boolean isFixupCRLF()
setFixupCRLF
public void setFixupCRLF(boolean fixupCRLF)
Copyright © 2013. All Rights Reserved.