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