|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.icl.saxon.output.Emitter com.icl.saxon.om.Builder
The abstract Builder class is responsible for taking a stream of SAX events and constructing a Document tree. There is one concrete subclass for each tree implementation.
Field Summary | |
protected int |
columnNumber
|
protected Controller |
controller
|
protected DocumentInfo |
currentDocument
|
protected boolean |
discardComments
|
protected org.xml.sax.ErrorHandler |
errorHandler
|
protected ErrorListener |
errorListener
|
protected java.io.Writer |
errorOutput
|
protected int |
estimatedLength
|
protected boolean |
failed
|
protected boolean |
inDTD
|
protected int |
lineNumber
|
protected boolean |
lineNumbering
|
protected PreviewManager |
previewManager
|
static int |
STANDARD_TREE
|
protected boolean |
started
|
protected Stripper |
stripper
|
protected boolean |
timing
|
static int |
TINY_TREE
|
Fields inherited from class com.icl.saxon.output.Emitter |
locator, namePool, outputProperties, outputStream, systemId, writer |
Fields inherited from interface javax.xml.transform.Result |
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING |
Constructor Summary | |
Builder()
create a Builder and initialise variables |
Method Summary | |
DocumentInfo |
build(SAXSource source)
Build the tree from an input source. |
void |
error(org.xml.sax.SAXParseException e)
Callback interface for SAX: not for application use |
void |
fatalError(org.xml.sax.SAXParseException e)
Callback interface for SAX: not for application use |
int |
getColumnNumber()
Return the character position where the current document event ends. |
DocumentInfo |
getCurrentDocument()
Get the current document |
int |
getLineNumber()
Return the line number where the current document event ends. |
java.lang.String |
getPublicId()
Return the public identifier for the current document event. |
Stripper |
getStripper()
Get the Stripper in use |
boolean |
isTiming()
Get timing option |
protected void |
reportError(org.xml.sax.SAXParseException e,
boolean isFatal)
Common routine for errors and fatal errors |
void |
setController(Controller c)
|
void |
setDiscardCommentsAndPIs(boolean discard)
Indicate whether comments and Processing Instructions should be discarded |
void |
setErrorHandler(org.xml.sax.ErrorHandler eh)
Set the SAX error handler to use. |
void |
setErrorListener(ErrorListener eh)
Set the JAXP error listener to use, if no SAX errorHandler has been provided. |
void |
setErrorOutput(java.io.Writer writer)
Set output for error messages produced by the default error handler. The default error handler does not throw an exception for parse errors or input I/O errors, rather it returns a result code and writes diagnostics to a user-specified output writer, which defaults to System.err This call has no effect if setErrorHandler() has been called to supply a user-defined error handler |
void |
setLineNumbering(boolean onOrOff)
Set line numbering on or off |
void |
setPreviewManager(PreviewManager pm)
Set the PreviewManager to use |
void |
setRootNode(DocumentInfo doc)
Set the root (document) node to use. |
void |
setStripper(Stripper s)
Set the Stripper to use |
void |
setTiming(boolean on)
Set timing option on or off |
abstract void |
setUnparsedEntity(java.lang.String name,
java.lang.String uri)
Set the URI for an unparsed entity in the document. |
void |
warning(org.xml.sax.SAXParseException e)
Callback interface for SAX: not for application use |
Methods inherited from class com.icl.saxon.output.Emitter |
characters, comment, endDocument, endElement, getNamePool, getOutputProperties, getOutputStream, getSystemId, getWriter, makeEmitter, processingInstruction, setDocumentLocator, setEscaping, setNamePool, setOutputProperties, setOutputStream, setSystemId, setWriter, startDocument, startElement, usesWriter |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.xml.sax.Locator |
getSystemId |
Methods inherited from interface javax.xml.transform.SourceLocator |
getSystemId |
Field Detail |
public static final int STANDARD_TREE
public static final int TINY_TREE
protected int estimatedLength
protected java.io.Writer errorOutput
protected Stripper stripper
protected PreviewManager previewManager
protected boolean discardComments
protected DocumentInfo currentDocument
protected org.xml.sax.ErrorHandler errorHandler
protected ErrorListener errorListener
protected boolean failed
protected boolean started
protected boolean timing
protected boolean inDTD
protected boolean lineNumbering
protected int lineNumber
protected int columnNumber
protected Controller controller
Constructor Detail |
public Builder()
Method Detail |
public void setController(Controller c)
public void setRootNode(DocumentInfo doc)
public void setTiming(boolean on)
public boolean isTiming()
public void setLineNumbering(boolean onOrOff)
public void setStripper(Stripper s)
public Stripper getStripper()
public void setPreviewManager(PreviewManager pm)
public void setDiscardCommentsAndPIs(boolean discard)
public void setErrorHandler(org.xml.sax.ErrorHandler eh)
eh
- The error handler to use. It must conform to the interface
org.xml.sax.ErrorHandlerpublic void setErrorListener(ErrorListener eh)
eh
- The error listener to use. It must conform to the interface
javax.xml.transform.ErrorListenerpublic void setErrorOutput(java.io.Writer writer)
writer
- The Writer to use for error messagespublic DocumentInfo build(SAXSource source) throws TransformerException
source
- The source to use. SAXSource is a SAX-defined class that
allows input from a URL, a byte stream, or a character stream. SAXON also
provides a subclass, ExtendedInputSource, that allows input directly from a File.
TransformerException
- if the input document could not be read or if it was not parsed
correctly.public DocumentInfo getCurrentDocument()
public void warning(org.xml.sax.SAXParseException e)
warning
in interface org.xml.sax.ErrorHandler
public void error(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException
error
in interface org.xml.sax.ErrorHandler
org.xml.sax.SAXException
public void fatalError(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException
fatalError
in interface org.xml.sax.ErrorHandler
org.xml.sax.SAXException
protected void reportError(org.xml.sax.SAXParseException e, boolean isFatal)
public abstract void setUnparsedEntity(java.lang.String name, java.lang.String uri)
setUnparsedEntity
in class Emitter
public java.lang.String getPublicId()
SourceLocator
The return value is the public identifier of the document entity or of the external parsed entity in which the markup that triggered the event appears.
getPublicId
in interface org.xml.sax.Locator
public int getLineNumber()
SourceLocator
Warning: The return value from the method is intended only as an approximation for the sake of error reporting; it is not intended to provide sufficient information to edit the character content of the original XML document.
The return value is an approximation of the line number in the document entity or external parsed entity where the markup that triggered the event appears.
getLineNumber
in interface org.xml.sax.Locator
public int getColumnNumber()
SourceLocator
Warning: The return value from the method is intended only as an approximation for the sake of error reporting; it is not intended to provide sufficient information to edit the character content of the original XML document.
The return value is an approximation of the column number in the document entity or external parsed entity where the markup that triggered the event appears.
getColumnNumber
in interface org.xml.sax.Locator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |