com.ibm.di.parser
Interface ParserInterface

All Known Implementing Classes:
CSVParser, DSMLParser, Dsmlv2Parser, FixedRecordParser, HTTPParser, LDIFParser, LineReader, ParserImpl, ScriptParser, SimpleParser, SOAPParser, SPMLv2Parser, XMLParser, XMLSaxParser, XSLbasedXMLParser

public interface ParserInterface

This is the interface implemented by TDI parsers.


Method Summary
 void closeParser()
          This method is called by the hosting component (e.g.
 void flush()
          This method is called by some hosting components to flush any in-memory data to the current output stream.
 Object getContext()
          Gets the context attribute of the ParserInterface object
 boolean getDebug()
          Gets the debug attribute of the ParserInterface object
 String getParam(String param)
          Gets the param attribute of the ParserInterface object
 ParserInterface getParser()
          Gets the parser attribute of the ParserInterface object
 BufferedReader getReader()
          Gets the reader attribute of the ParserInterface object
 BufferedWriter getWriter()
          Gets the writer attribute of the ParserInterface object
 void initParser()
          This method is called by the hosting component (e.g.
 boolean isDeltaSupported()
          Returns true if this connector is able to perform delta updates
 Entry readEntry()
          Return the next entry from the current input stream
 void registerScriptBeans(ScriptEngine se)
          Called by the hosting component (e.g.
 void setConfiguration(ParserConfig config)
          Sets the configuration attribute of the ParserInterface object
 void setContext(Object context)
          Sets the context attribute of the ParserInterface object
 void setDebug(boolean debug)
          Sets the debug attribute of the ParserInterface object
 void setInputStream(InputStream is)
          Sets the inputStream attribute of the ParserInterface object
 void setInputStream(Reader is)
          Sets the inputStream attribute of the ParserInterface object
 void setInputStream(String is)
          Sets the inputStream attribute of the ParserInterface object
 void setOutputStream(OutputStream os)
          Sets the outputStream attribute of the ParserInterface object
 void setOutputStream(Writer os)
          Sets the outputStream attribute of the ParserInterface object
 void setParam(String param, String value)
          Sets the param attribute of the ParserInterface object
 void setParser(ParserInterface parser)
          Sets the parser attribute of the ParserInterface object
 void writeEntry(Entry entry)
          Write an entry to the current output stream
 

Method Detail

setInputStream

void setInputStream(InputStream is)
Sets the inputStream attribute of the ParserInterface object

Parameters:
is - The new inputStream value
Since:

setOutputStream

void setOutputStream(OutputStream os)
Sets the outputStream attribute of the ParserInterface object

Parameters:
os - The new outputStream value
Since:

setInputStream

void setInputStream(String is)
Sets the inputStream attribute of the ParserInterface object

Parameters:
is - The new inputStream value
Since:

setInputStream

void setInputStream(Reader is)
Sets the inputStream attribute of the ParserInterface object

Parameters:
is - The new inputStream value
Since:

setOutputStream

void setOutputStream(Writer os)
Sets the outputStream attribute of the ParserInterface object

Parameters:
os - The new outputStream value
Since:

setParser

void setParser(ParserInterface parser)
Sets the parser attribute of the ParserInterface object

Parameters:
parser - The new parser value
Since:

getParser

ParserInterface getParser()
Gets the parser attribute of the ParserInterface object

Returns:
The parser value
Since:

getReader

BufferedReader getReader()
Gets the reader attribute of the ParserInterface object

Returns:
The reader value
Since:

getWriter

BufferedWriter getWriter()
Gets the writer attribute of the ParserInterface object

Returns:
The writer value
Since:

writeEntry

void writeEntry(Entry entry)
                throws Exception
Write an entry to the current output stream

Parameters:
entry - The entry to write
Throws:
Exception
Since:

readEntry

Entry readEntry()
                throws Exception
Return the next entry from the current input stream

Returns:
The next entry from the input stream
Throws:
Exception
Since:

initParser

void initParser()
                throws Exception
This method is called by the hosting component (e.g. connector) to initialize the parser.

Throws:
Exception
Since:

closeParser

void closeParser()
                 throws Exception
This method is called by the hosting component (e.g. connector) to close and release parser resources.

Throws:
Exception
Since:

flush

void flush()
           throws Exception
This method is called by some hosting components to flush any in-memory data to the current output stream.

Throws:
Exception

setConfiguration

void setConfiguration(ParserConfig config)
Sets the configuration attribute of the ParserInterface object

Parameters:
config - The new configuration value

getParam

String getParam(String param)
Gets the param attribute of the ParserInterface object

Parameters:
param - The parameter name
Returns:
The param value
Since:

setParam

void setParam(String param,
              String value)
Sets the param attribute of the ParserInterface object

Parameters:
param - The new param value
value - The new param value
Since:

setContext

void setContext(Object context)
Sets the context attribute of the ParserInterface object

Parameters:
context - The new context value
Since:

getContext

Object getContext()
Gets the context attribute of the ParserInterface object

Returns:
The context value
Since:

registerScriptBeans

void registerScriptBeans(ScriptEngine se)
                         throws Exception
Called by the hosting component (e.g. connector) to let the parser register its own script beans in the script engine.

Parameters:
se - The script engine
Throws:
Exception
Since:

getDebug

boolean getDebug()
Gets the debug attribute of the ParserInterface object

Returns:
The debug value
Since:

setDebug

void setDebug(boolean debug)
Sets the debug attribute of the ParserInterface object

Parameters:
debug - The new debug value
Since:

isDeltaSupported

boolean isDeltaSupported()
Returns true if this connector is able to perform delta updates

Returns:
true if delta updates are supported, false otherwise