|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.parser.ParserImpl
public abstract class ParserImpl
The ParserImpl class provides the base class for parser implementations. This class provides common methods and properties that apply to all parsers.
Field Summary | |
---|---|
protected boolean |
_debug
True if debug is enabled; false otherwise. |
protected ParserConfig |
myConfiguration
The parser's configuration. |
Constructor Summary | |
---|---|
ParserImpl()
Default constructor. |
Method Summary | |
---|---|
void |
closeParser()
Close parser and deallocate resources. |
void |
debug(java.lang.String msg)
Writes a message to the log if debug mode is set. |
boolean |
debugMode()
Returns current status of the debugMode flag. |
void |
flush()
This method is called by some hosting components to flush any in-memory data to the current output stream. |
static java.lang.Object |
getClassInstance(java.lang.String className)
Create a parser instance. |
java.lang.Object |
getContext()
Return the context in which this parser is running (e.g. |
boolean |
getDebug()
Returns current status of the debugMode flag. |
java.io.InputStream |
getInputStream()
Return current input-stream object. |
java.io.OutputStream |
getOutputStream()
Return current output-stream object. |
java.lang.String |
getParam(java.lang.String param)
Return configuration value. |
ParserInterface |
getParser()
Return the chained parser (future implementation). |
java.io.BufferedReader |
getReader()
Return current reader object. |
java.io.BufferedWriter |
getWriter()
Return current writer object. |
void |
initParser()
Perform initialization of parser. |
boolean |
isDeltaSupported()
Returns true if this connector is able to perform delta updates |
void |
logmsg(java.lang.String msg)
Writes a message to the log. |
java.lang.Object |
querySchema(java.lang.Object source)
Discover the schema for the Parser. |
void |
registerScriptBeans(ScriptEngine se)
Register objects in the script engine. |
void |
setConfiguration(ParserConfig config)
Set the parser configuration. |
void |
setContext(java.lang.Object context)
Set the context in which the parser runs. |
void |
setDebug(boolean debug)
Sets the status of the debugMode flag. |
void |
setInputStream(java.io.InputStream is)
Set the parser input stream. |
void |
setInputStream(java.io.Reader is)
Use Reader object for input. |
void |
setInputStream(java.lang.String is)
Use a string as input. |
void |
setOutputStream(java.io.OutputStream os)
Set the parser output stream. |
void |
setOutputStream(java.io.Writer os)
Use Writer object for output. |
void |
setParam(java.lang.String param,
java.lang.String value)
Set parser configuration value. |
void |
setParser(ParserInterface parser)
Set the chained parser (future implementation). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.ibm.di.parser.ParserInterface |
---|
readEntry, writeEntry |
Methods inherited from interface com.ibm.di.server.VersionInfoInterface |
---|
getVersion |
Field Detail |
---|
protected ParserConfig myConfiguration
protected volatile boolean _debug
True
if debug is enabled; false
otherwise.
May be accessed by different threads.
Constructor Detail |
---|
public ParserImpl()
Method Detail |
---|
public java.lang.Object getContext()
getContext
in interface ParserInterface
public void setContext(java.lang.Object context)
setContext
in interface ParserInterface
context
- The context objectpublic void setParser(ParserInterface parser)
setParser
in interface ParserInterface
parser
- The chained parserpublic ParserInterface getParser()
getParser
in interface ParserInterface
public void setParam(java.lang.String param, java.lang.String value)
setParam
in interface ParserInterface
param
- The parameter namevalue
- The parameter valuepublic java.lang.String getParam(java.lang.String param)
getParam
in interface ParserInterface
param
- The name of the parameter to return
public void setConfiguration(ParserConfig config)
setConfiguration
in interface ParserInterface
config
- The configuration objectpublic void setInputStream(java.io.InputStream is)
setInputStream
in interface ParserInterface
is
- The InputStream object (e.g. FileInputStream,
SocketInputStream etc. ..)public void setOutputStream(java.io.OutputStream os)
setOutputStream
in interface ParserInterface
os
- The OutputStream object (e.g. FileOutputStream,
SocketOutputStream etc. ..)public void setInputStream(java.lang.String is)
setInputStream
in interface ParserInterface
is
- String to read data frompublic void setInputStream(java.io.Reader is)
setInputStream
in interface ParserInterface
is
- Reader objectpublic void setOutputStream(java.io.Writer os)
setOutputStream
in interface ParserInterface
os
- Writer objectpublic java.io.BufferedReader getReader()
getReader
in interface ParserInterface
public java.io.BufferedWriter getWriter()
getWriter
in interface ParserInterface
public java.io.InputStream getInputStream()
public java.io.OutputStream getOutputStream()
public void initParser() throws java.lang.Exception
initParser
in interface ParserInterface
java.lang.Exception
- if an error occurs.public void closeParser() throws java.lang.Exception
closeParser
in interface ParserInterface
java.lang.Exception
- if an error occurs.public static java.lang.Object getClassInstance(java.lang.String className) throws java.lang.Exception
className
- The complete Java class name
java.lang.Exception
- className
could not be found.public void logmsg(java.lang.String msg)
msg
- The log messagepublic void debug(java.lang.String msg)
msg
- The log messagepublic boolean debugMode()
true
if debug mode is enabled, false
otherwise.public boolean getDebug()
getDebug
in interface ParserInterface
public void setDebug(boolean debug)
setDebug
in interface ParserInterface
debug
- True if debug mode is enabled, false otherwise.public void registerScriptBeans(ScriptEngine se) throws java.lang.Exception
registerScriptBeans
in interface ParserInterface
se
- The script engine
java.lang.Exception
public void flush() throws java.lang.Exception
flush
in interface ParserInterface
java.lang.Exception
public boolean isDeltaSupported()
isDeltaSupported
in interface ParserInterface
false
public java.lang.Object querySchema(java.lang.Object source) throws java.lang.Exception
querySchema
in interface ParserInterface
source
- The object on which to discover schema
java.lang.Exception
- If an I/O error occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |