|
|||||||||||
| 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(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 Object |
getClassInstance(String className)
Create a parser instance. |
Object |
getContext()
Return the context in which this parser is running (e.g. |
boolean |
getDebug()
Returns current status of the debugMode flag. |
InputStream |
getInputStream()
Return current input-stream object. |
OutputStream |
getOutputStream()
Return current output-stream object. |
String |
getParam(String param)
Return configuration value. |
ParserInterface |
getParser()
Return the chained parser (future implementation). |
BufferedReader |
getReader()
Return current reader object. |
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(String msg)
Writes a message to the log. |
Object |
querySchema(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(Object context)
Set the context in which the parser runs. |
void |
setDebug(boolean debug)
Sets the status of the debugMode flag. |
void |
setInputStream(InputStream is)
Set the parser input stream. |
void |
setInputStream(Reader is)
Use Reader object for input. |
void |
setInputStream(String is)
Use a string as input. |
void |
setOutputStream(OutputStream os)
Set the parser output stream. |
void |
setOutputStream(Writer os)
Use Writer object for output. |
void |
setParam(String param,
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 Object getContext()
getContext in interface ParserInterfacepublic void setContext(Object context)
setContext in interface ParserInterfacecontext - The context objectpublic void setParser(ParserInterface parser)
setParser in interface ParserInterfaceparser - The chained parserpublic ParserInterface getParser()
getParser in interface ParserInterface
public void setParam(String param,
String value)
setParam in interface ParserInterfaceparam - The parameter namevalue - The parameter valuepublic String getParam(String param)
getParam in interface ParserInterfaceparam - The name of the parameter to return
public void setConfiguration(ParserConfig config)
setConfiguration in interface ParserInterfaceconfig - The configuration objectpublic void setInputStream(InputStream is)
setInputStream in interface ParserInterfaceis - The InputStream object (e.g. FileInputStream,
SocketInputStream etc. ..)public void setOutputStream(OutputStream os)
setOutputStream in interface ParserInterfaceos - The OutputStream object (e.g. FileOutputStream,
SocketOutputStream etc. ..)public void setInputStream(String is)
setInputStream in interface ParserInterfaceis - String to read data frompublic void setInputStream(Reader is)
setInputStream in interface ParserInterfaceis - Reader objectpublic void setOutputStream(Writer os)
setOutputStream in interface ParserInterfaceos - Writer objectpublic BufferedReader getReader()
getReader in interface ParserInterfacepublic BufferedWriter getWriter()
getWriter in interface ParserInterfacepublic InputStream getInputStream()
public OutputStream getOutputStream()
public void initParser()
throws Exception
initParser in interface ParserInterfaceException - if an error occurs.
public void closeParser()
throws Exception
closeParser in interface ParserInterfaceException - if an error occurs.
public static Object getClassInstance(String className)
throws Exception
className - The complete Java class name
Exception - className could not be found.public void logmsg(String msg)
msg - The log messagepublic void debug(String msg)
msg - The log messagepublic boolean debugMode()
true if debug mode is enabled, false
otherwise.public boolean getDebug()
getDebug in interface ParserInterfacepublic void setDebug(boolean debug)
setDebug in interface ParserInterfacedebug - True if debug mode is enabled, false otherwise.
public void registerScriptBeans(ScriptEngine se)
throws Exception
registerScriptBeans in interface ParserInterfacese - The script engine
Exception
public void flush()
throws Exception
flush in interface ParserInterfaceExceptionpublic boolean isDeltaSupported()
isDeltaSupported in interface ParserInterfacefalse
public Object querySchema(Object source)
throws Exception
querySchema in interface ParserInterfacesource - The object on which to discover schema
Exception - If an I/O error occurs
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||