com.ibm.di.parser
Interface ParserInterface

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

public interface ParserInterface

This is the interface implemented by all 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.
 java.lang.Object getContext()
          Gets the context attribute of the ParserInterface object.
 boolean getDebug()
          Gets the debug attribute of the ParserInterface object.
 java.lang.String getParam(java.lang.String param)
          Gets the param attribute of the ParserInterface object.
 ParserInterface getParser()
          Gets the parser attribute of the ParserInterface object.
 java.io.BufferedReader getReader()
          Gets the reader attribute of the ParserInterface object.
 java.io.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.
 java.lang.Object querySchema(java.lang.Object source)
          Discover the schema for the Parser.
 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(java.lang.Object context)
          Sets the context attribute of the ParserInterface object.
 void setDebug(boolean debug)
          Sets the debug attribute of the ParserInterface object.
 void setInputStream(java.io.InputStream is)
          Sets the inputStream attribute of the ParserInterface object.
 void setInputStream(java.io.Reader is)
          Sets the inputStream attribute of the ParserInterface object.
 void setInputStream(java.lang.String is)
          Sets the inputStream attribute of the ParserInterface object.
 void setOutputStream(java.io.OutputStream os)
          Sets the outputStream attribute of the ParserInterface object.
 void setOutputStream(java.io.Writer os)
          Sets the outputStream attribute of the ParserInterface object.
 void setParam(java.lang.String param, java.lang.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(java.io.InputStream is)
Sets the inputStream attribute of the ParserInterface object.

Parameters:
is - The new inputStream value

setOutputStream

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

Parameters:
os - The new outputStream value

setInputStream

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

Parameters:
is - The new inputStream value

setInputStream

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

Parameters:
is - The new inputStream value

setOutputStream

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

Parameters:
os - The new outputStream value

setParser

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

Parameters:
parser - The new parser value

getParser

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

Returns:
The parser value

getReader

java.io.BufferedReader getReader()
Gets the reader attribute of the ParserInterface object.

Returns:
The reader value

getWriter

java.io.BufferedWriter getWriter()
Gets the writer attribute of the ParserInterface object.

Returns:
The writer value

writeEntry

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

Parameters:
entry - The entry to write
Throws:
java.lang.Exception - if an error occurs.

readEntry

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

Returns:
The next entry from the input stream
Throws:
java.lang.Exception

initParser

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

Throws:
java.lang.Exception - if an error occurs.

closeParser

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

Throws:
java.lang.Exception - If an I/O error occurs

flush

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

Throws:
java.lang.Exception

setConfiguration

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

Parameters:
config - The new configuration value

getParam

java.lang.String getParam(java.lang.String param)
Gets the param attribute of the ParserInterface object.

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

setParam

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

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

setContext

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

Parameters:
context - The new context value

getContext

java.lang.Object getContext()
Gets the context attribute of the ParserInterface object.

Returns:
The context value

registerScriptBeans

void registerScriptBeans(ScriptEngine se)
                         throws java.lang.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:
java.lang.Exception

getDebug

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

Returns:
The debug value

setDebug

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

Parameters:
debug - The new debug value

isDeltaSupported

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

Returns:
true if delta updates are supported, false otherwise

querySchema

java.lang.Object querySchema(java.lang.Object source)
                             throws java.lang.Exception
Discover the schema for the Parser. For example, a XML Parser could return a representation of the XML Schema or the DTD referenced in a XML file.

Parameters:
source - The object on which to discover schema
Returns:
A Vector of com.ibm.di.entry.Entry objects describing each entity
Throws:
java.lang.Exception - If an I/O error occurs
Since:
7.0