lux.xml
Class OffsetDocBuilder

java.lang.Object
  extended by lux.xml.SaxonDocBuilder
      extended by 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.


Field Summary
 
Fields inherited from class lux.xml.SaxonDocBuilder
writer
 
Constructor Summary
OffsetDocBuilder(net.sf.saxon.s9api.Processor processor)
           
 
Method Summary
 Offsets getOffsets()
           
 void handleEvent(XMLStreamReader reader, int eventType)
          This method receives StAX events.
 boolean isFixupCRLF()
           
 void reset()
          reinitialize any internal state and prepare the handler for re-use
 void setFixupCRLF(boolean fixupCRLF)
           
 
Methods inherited from class lux.xml.SaxonDocBuilder
getDocument
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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
Method Detail

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 read
eventType - 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.