All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.beans.script.comps.java.SCRJavaGenerator

java.lang.Object
   |
   +----com.ibm.beans.script.comps.java.SCRJavaGenerator

public class SCRJavaGenerator
extends Object
This is the class responsible for generating the Java class.


Variable Index

 o INDENT
Indicates theindentation constant.
 o lineNum
Indicates the line number in the script source code.
 o outStream
Indicates the output stream for writing script code.
 o scrComponent
Indicates the Java component.
 o timeStamp
Indicates the time stamp used to generate a random source file name.

Constructor Index

 o SCRJavaGenerator(SCRJavaComponent)
Constructor for SCRJavaGenerator.

Method Index

 o codeGen(Vector)
Generates the Java source code.
 o compile(String, boolean)
Compiles the Java source file.
 o gen(String)
Writes the string to the output stream.
 o genByName(SCRIDEInstance, String)
Generates the related source code for each registered Java object and event method.
 o genCompile(Vector, boolean)
Generates the Java source code and compiles it into a Java class.
 o genDeclaration(SCRObjectHandle)
Generates the declaration for a registered Java object.
 o genEditableObject(SCRJavaEditableObj)
Generates the code associated with the SCRJavaEditableObj.
 o genInitialization(SCRObjectHandle)
Generates the system initialization code for a registered Java object
 o getFileExtension()
Gets the file extension for the script source file.
 o getScriptClassName()
Requests the name of the script class that is generated by this Java generator.
 o shortName(String)
Gets the short name for an imported class.

Variables

 o INDENT
 protected static final String INDENT
Indicates theindentation constant.

 o scrComponent
 protected SCRJavaComponent scrComponent
Indicates the Java component.

 o outStream
 protected DataOutputStream outStream
Indicates the output stream for writing script code.

 o timeStamp
 protected long timeStamp
Indicates the time stamp used to generate a random source file name.

 o lineNum
 protected int lineNum
Indicates the line number in the script source code.

Constructors

 o SCRJavaGenerator
 public SCRJavaGenerator(SCRJavaComponent newScrComponent)
Constructor for SCRJavaGenerator.

Parameters:
newScrComponent - The Java scripting component.

Methods

 o genCompile
 public byte[] genCompile(Vector edit_objs,
                          boolean withDebug)
Generates the Java source code and compiles it into a Java class.

Parameters:
edit_objs - A Vector of editable objects from the scripting IDE.
withDebug -
true, to compile with the debug flag set; false, to compile without debug flag set.
Returns:
The generated java class name in a byte array.
 o codeGen
 protected void codeGen(Vector edit_objs) throws Exception
Generates the Java source code.

Parameters:
edit_objs - A Vector of editable objects.
Throws: Exception
Thrown if code generation fails.
 o genByName
 protected void genByName(SCRIDEInstance instance,
                          String eventName)
Generates the related source code for each registered Java object and event method.

Parameters:
instance - The IDE instance associated with the Java object.
eventName - The event method name.
 o genDeclaration
 protected void genDeclaration(SCRObjectHandle handle)
Generates the declaration for a registered Java object.

Parameters:
handle - The object handle associate with the Java object.
 o genInitialization
 protected void genInitialization(SCRObjectHandle handle)
Generates the system initialization code for a registered Java object

Parameters:
handle - The object handle associated with the Java object.
 o shortName
 protected String shortName(String longName)
Gets the short name for an imported class.

Parameters:
longName - The full name of the class.
Returns:
The short name of the class.
 o genEditableObject
 protected void genEditableObject(SCRJavaEditableObj editableObject)
Generates the code associated with the SCRJavaEditableObj.

Parameters:
editableObject - The SCRJavaEditableObj for which source code is to be generated.
 o gen
 protected void gen(String s)
Writes the string to the output stream.

Parameters:
s - The string to write.
 o compile
 protected boolean compile(String fname,
                           boolean withDebug)
Compiles the Java source file.

Parameters:
fname - The Java source file name.
withDebug -
true, to compile with the debug flag set; false, to compile without the debug flag set.
Returns:
true, if compile successful; false, if compile fialed.
 o getFileExtension
 protected String getFileExtension()
Gets the file extension for the script source file.

Returns:
Script source file extension.
 o getScriptClassName
 public String getScriptClassName()
Requests the name of the script class that is generated by this Java generator.

Returns:
The name of the script class.

All Packages  Class Hierarchy  This Package  Previous  Next  Index