public class Process extends java.lang.Object implements java.lang.Runnable, PipelineConstants, ErrorHandler
COMPSTREAMRESULT, COMPSTREAMSOURCE, DOCFRAG, DOCUMENT, DOMRESULT, DOMSOURCE, ELEMENT, PROCESS_WAITING, SAXRESULT, SAXSOURCE, STREAMRESULT, STREAMSOURCE| Modifier and Type | Method and Description |
|---|---|
void |
convertFromDOM(DOMResult res, Output output)
Should be called by the Process which outputs DOM.
|
void |
convertFromSAX(SAXResult result, Output output)
Should be called by the Process which outputs SAX events.
|
void |
convertFromStream(StreamResult res, Output output)
Should be called by the Process which outputs xml as Stream.
|
void |
error(int type, java.lang.Exception e)
Called by a custom Process whenever an error occurs.
|
XMLDocument |
getErrorDocument(java.lang.String errorName, boolean convert)
Get the error element as an XML Document tree
|
Source |
getErrorSource(java.lang.String errorName)
Retrieve the error element as Source
|
java.io.InputStream |
getErrorStream(java.lang.String errorName, boolean convert)
Get the error element as an Input stream for reading error.
|
void |
getErrorStream(java.lang.String errorName, java.io.OutputStream out, boolean convert)
Write the error element to the outputstream provided.
|
java.lang.Object |
getInParamValue(java.lang.String name)
Get an input param value based on its name
|
Input |
getInput(java.lang.String inputName)
Retrieve the Input object by name
|
java.lang.Object |
getOutParamValue(java.lang.String name)
Get the output param value based on its name
|
Output |
getOutput(java.lang.String outputName)
Retrieve a particular output by name
|
java.io.OutputStream |
getOutputStream(java.lang.String outputName)
Get the output stream for printing to a specific output
|
java.io.Writer |
getOutputWriter(java.lang.String outputName)
Get the output writer for writing to a specific output
|
ContentHandler |
getSAXContentHandler(Output out)
Get the ContentHandler which will handle the sax events generated.
|
ErrorHandler |
getSAXErrorHandler(Output out)
Get the SAX ErrorHandler which will handle the sax error events generated.
|
void |
info(java.lang.String msg)
Called by a Process to report an informational message and continue with execution.
|
void |
setOutputResult(java.lang.String outputName, Result res)
All user defined processes (extending from Process) need to create a Result object and set it in the output using this method.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waiterror, fatalError, warningpublic final Input getInput(java.lang.String inputName)
inputName - input name as Stringpublic Output getOutput(java.lang.String outputName)
outputName - as a Stringpublic final java.lang.Object getInParamValue(java.lang.String name)
name - name of InParam as Stringpublic final java.lang.Object getOutParamValue(java.lang.String name)
name - OutParam name as String
public final void setOutputResult(java.lang.String outputName,
Result res)
outputName - as Stringres - Result object
public final java.io.OutputStream getOutputStream(java.lang.String outputName)
throws java.io.FileNotFoundException,
java.io.IOException
outputName - name of outputjava.io.FileNotFoundExceptionjava.io.IOException
public final java.io.Writer getOutputWriter(java.lang.String outputName)
throws java.io.FileNotFoundException,
java.io.IOException
outputName - name of outputjava.io.FileNotFoundExceptionjava.io.IOExceptionpublic Source getErrorSource(java.lang.String errorName)
errorName - name of error from pipeline document
public void getErrorStream(java.lang.String errorName,
java.io.OutputStream out,
boolean convert)
throws java.io.IOException
errorName - name of error elementout - outputstream to write toconvert - convert from DOM to stream or notjava.io.IOException - while writing to outputstream
public final java.io.InputStream getErrorStream(java.lang.String errorName,
boolean convert)
throws java.io.IOException
errorName - error element name as Stringconvert - convert from Node to InputStream or notjava.io.IOException - reading from error elementpublic XMLDocument getErrorDocument(java.lang.String errorName, boolean convert) throws SAXException, XMLParseException, java.io.IOException
errorName - error element name as Stringconvert - convert from stream to DOM if necessarySAXException - while parsingXMLParseException - while parsingjava.io.IOException
public final void error(int type,
java.lang.Exception e)
throws PipelineException
type - error type as defined in PipelineConstantse - exceptionPipelineExceptionpublic void info(java.lang.String msg)
msg - - message to reportpublic final ContentHandler getSAXContentHandler(Output out) throws PipelineException
out - the Output object which is the SAX sourcePipelineExceptionpublic final ErrorHandler getSAXErrorHandler(Output out)
out - Output object which is the SAX sourcePipelineExceptionpublic final void convertFromSAX(SAXResult result, Output output) throws java.io.FileNotFoundException, java.io.IOException
result - the process result as a SAXResult objectoutput - output object to be associated with the SAX, to be piped into the input of the next process in pipelineFileNoFoundExceptionjava.io.IOExceptionjava.io.FileNotFoundExceptionpublic final void convertFromDOM(DOMResult res, Output output) throws SAXException, java.io.IOException, PipelineException
res - the process result as a DOMResult objectoutput - output object associated with result, to be piped to the next process in pipelineSAXExceptionjava.io.IOExceptionPipelineExceptionpublic final void convertFromStream(StreamResult res, Output output) throws SAXException, java.io.IOException, PipelineException
res - the process result as a StreamResult objectoutput - output object to be associated with the result, to be piped to the input of the next process in the pipelineSAXExceptionjava.io.IOExceptionPipelineException