All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.beans.script.SCRCodeGenUtils

java.lang.Object
   |
   +----com.ibm.beans.script.SCRCodeGenUtils

public class SCRCodeGenUtils
extends Object
The SCRCodeGenUtils class implements certain utility functions that are used in the code generation process by the event processor and the Java scripting component.


Constructor Index

 o SCRCodeGenUtils()

Method Index

 o compileCode(String, String[])
Compiles Java code.
 o createTempDir()
Creates a temporary directory where code generated by the scripting engine is stored.
 o exportCode(String, BufferedWriter)
Writes a fragment of code to an output buffer.
 o exportLine(String, BufferedWriter)
Writes a string to an output buffer.
 o fireEvent(Vector, String, EventObject, Object)
Fires a specified event for a specified set of event listeners.
 o getClassDisplayName(Class)
Requests the name of the class that is displayed in the IDE.
 o getFinalClass(Class)
Requests a Class for any arbitrary Java data type including arrays.
 o getFinalClassName(Class)
Requests a class name for any arbitrary Java data type including arrays.
 o importCode(BufferedReader)
Requests the next fragment of code from the buffer that contains an exported script.
 o importInt(BufferedReader)
Requests the next index from the buffer that contains an exported script.
 o importLine(BufferedReader, boolean)
Requests the next line of code from an input buffer that contains an exported script..
 o importNoneEmptyLine(BufferedReader, boolean)
Requests the next non-empty line of code from an input buffer that contains an exported script.
 o importString(BufferedReader)
Requests the next string from the buffer that contains an exported script.
 o loadByteArray(String)
Loads a file into a byte array.

Constructors

 o SCRCodeGenUtils
 public SCRCodeGenUtils()

Methods

 o createTempDir
 public static String createTempDir()
Creates a temporary directory where code generated by the scripting engine is stored. The temporary directory is the same as the working directory specified in the BeanSystem properties.

Returns:
The temporary directory defined as BeanSystem property.
 o compileCode
 public static boolean compileCode(String fname,
                                   String flags[])
Compiles Java code.

Parameters:
fname - The name of the Java source file.
flags - Compilation flags used by the javac compiler.
Returns:
true, if compile successful. false, if compile failed.
 o loadByteArray
 public static byte[] loadByteArray(String fname)
Loads a file into a byte array.

Parameters:
fname - Name of the file.
Returns:
The byte array into which the file is loaded.
 o fireEvent
 public static void fireEvent(Vector listeners,
                              String method_name,
                              EventObject event,
                              Object src)
Fires a specified event for a specified set of event listeners.

Parameters:
listeners - A set of listeners that listen to the event.
method_name - The name of the method that is invoked on all listeners.
event - The event object.
src - The event source.
 o getClassDisplayName
 public static String getClassDisplayName(Class cls)
Requests the name of the class that is displayed in the IDE.

Parameters:
cls - Class
Returns:
Display name of the class
 o getFinalClass
 public static Class getFinalClass(Class cls)
Requests a Class for any arbitrary Java data type including arrays.

Parameters:
cls - The Java data type.
Returns:
The class for a data type.
 o getFinalClassName
 public static String getFinalClassName(Class cls)
Requests a class name for any arbitrary Java data type including arrays.

Parameters:
cls - The Java data type.
Returns:
The class name for a data type.
 o importLine
 public static String importLine(BufferedReader in,
                                 boolean check_comment)
Requests the next line of code from an input buffer that contains an exported script..

Parameters:
in - The input buffer.
check_comment - Specifies if a comment line is to be ignored.
Returns:
The next line of code from the script.
 o importNoneEmptyLine
 public static String importNoneEmptyLine(BufferedReader in,
                                          boolean check_comment)
Requests the next non-empty line of code from an input buffer that contains an exported script.

Parameters:
in - The input buffer.
check_comment - Specifies if a comment line is to be ignored.
Returns:
The next line of code from the script.
 o importString
 public static String importString(BufferedReader in)
Requests the next string from the buffer that contains an exported script.

Parameters:
in - The input buffer.
Returns:
The next string of code from the script file.
 o importInt
 public static int importInt(BufferedReader in)
Requests the next index from the buffer that contains an exported script.

Parameters:
in - The input buffer.
Returns:
The index from the script file.
 o importCode
 public static String importCode(BufferedReader in)
Requests the next fragment of code from the buffer that contains an exported script.

Parameters:
in - The input buffer.
Returns:
The fragment of code from the script file.
 o exportLine
 public static void exportLine(String str,
                               BufferedWriter out)
Writes a string to an output buffer.

Parameters:
str - The string to be written out.
out - The output buffer.
 o exportCode
 public static void exportCode(String str,
                               BufferedWriter out)
Writes a fragment of code to an output buffer.

Parameters:
str - The code to be written out.
out - The output buffer.

All Packages  Class Hierarchy  This Package  Previous  Next  Index