com.ibm.di.fc
Class ScriptedFC

java.lang.Object
  extended by com.ibm.di.fc.Function
      extended by com.ibm.di.fc.ScriptedFC
All Implemented Interfaces:
FunctionInterface, VersionInfoInterface, ActionListener, EventListener

public class ScriptedFC
extends Function
implements ActionListener

This is a function component that relays FC operations to a user defined script.


Field Summary
 
Fields inherited from class com.ibm.di.fc.Function
logger
 
Constructor Summary
ScriptedFC()
           
 
Method Summary
 void actionPerformed(ActionEvent event)
          This method enables the script to use action listeners.
 Object callFunction(String func, Object[] params)
           
 Component getUI()
          This method returns the user interface component presented to the user to configure the operational configuration of the function.
 String getVersion()
          Return version information
 void initialize(Object obj)
          Called once to initialize the function
 Object perform(Object obj)
          If this method is called with an object of type java.lang.String, java.io.File, java.io.InputStream or java.io.Reader the configured parser is provided that object as input and the returned value is an Entry object resulting from the parsing.
 void terminate()
          This method is/should be called once before the object is released
 
Methods inherited from class com.ibm.di.fc.Function
debug, getConfiguration, getContext, getLog, getParam, initialize, logmsg, setConfiguration, setContext, setLog, setParam, updateSchema, verifyInitialized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptedFC

public ScriptedFC()
Method Detail

initialize

public void initialize(Object obj)
                throws Exception
Called once to initialize the function

Specified by:
initialize in interface FunctionInterface
Overrides:
initialize in class Function
Parameters:
obj - an initialization object passed directly to the script function "initialize"
Throws:
Exception - An exception is thrown if this method fails.

terminate

public void terminate()
               throws Exception
Description copied from class: Function
This method is/should be called once before the object is released

Specified by:
terminate in interface FunctionInterface
Overrides:
terminate in class Function
Throws:
Exception - An exception is thrown if this method fails.

callFunction

public Object callFunction(String func,
                           Object[] params)
                    throws Exception
Throws:
Exception

getUI

public Component getUI()
This method returns the user interface component presented to the user to configure the operational configuration of the function.

Specified by:
getUI in interface FunctionInterface
Overrides:
getUI in class Function
Returns:
The uI value

actionPerformed

public void actionPerformed(ActionEvent event)
This method enables the script to use action listeners. The script must use addActionListener(fc), which in turn will forward the action event to the script function "actionPerformed(fc, event)".

Specified by:
actionPerformed in interface ActionListener

perform

public Object perform(Object obj)
               throws Exception
If this method is called with an object of type java.lang.String, java.io.File, java.io.InputStream or java.io.Reader the configured parser is provided that object as input and the returned value is an Entry object resulting from the parsing. If this method is called with an Entry object, the parser is used to generate a byte stream that is returned either as a byte array or java.lang.String object. The latter depends on the configuration switch "returnString" setting.

Specified by:
perform in interface FunctionInterface
Parameters:
obj - the input object for the function
Returns:
the output object for the function
Throws:
Exception - An exception is thrown if this method fails.

getVersion

public String getVersion()
Return version information

Specified by:
getVersion in interface VersionInfoInterface
Returns:
The version value