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.
-
INDENT
- Indicates theindentation constant.
-
lineNum
- Indicates the line number in the script source code.
-
outStream
- Indicates the output stream for writing script code.
-
scrComponent
- Indicates the Java component.
-
timeStamp
- Indicates the time stamp used to generate a random source file name.
-
SCRJavaGenerator(SCRJavaComponent)
- Constructor for SCRJavaGenerator.
-
codeGen(Vector)
- Generates the Java source code.
-
compile(String, boolean)
- Compiles the Java source file.
-
gen(String)
- Writes the string to the output stream.
-
genByName(SCRIDEInstance, String)
- Generates the related source code for each registered Java object and
event method.
-
genCompile(Vector, boolean)
- Generates the Java source code and compiles it into a Java class.
-
genDeclaration(SCRObjectHandle)
- Generates the declaration for a registered Java object.
-
genEditableObject(SCRJavaEditableObj)
- Generates the code associated with the SCRJavaEditableObj.
-
genInitialization(SCRObjectHandle)
- Generates the system initialization code for a registered Java object
-
getFileExtension()
- Gets the file extension for the script source file.
-
getScriptClassName()
- Requests the name of the script class that is generated by this
Java generator.
-
shortName(String)
- Gets the short name for an imported class.
INDENT
protected static final String INDENT
- Indicates theindentation constant.
scrComponent
protected SCRJavaComponent scrComponent
- Indicates the Java component.
outStream
protected DataOutputStream outStream
- Indicates the output stream for writing script code.
timeStamp
protected long timeStamp
- Indicates the time stamp used to generate a random source file name.
lineNum
protected int lineNum
- Indicates the line number in the script source code.
SCRJavaGenerator
public SCRJavaGenerator(SCRJavaComponent newScrComponent)
- Constructor for SCRJavaGenerator.
- Parameters:
- newScrComponent - The Java scripting component.
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.
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.
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.
genDeclaration
protected void genDeclaration(SCRObjectHandle handle)
- Generates the declaration for a registered Java object.
- Parameters:
- handle - The object handle associate with the Java object.
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.
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.
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.
gen
protected void gen(String s)
- Writes the string to the output stream.
- Parameters:
- s - The string to write.
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.
getFileExtension
protected String getFileExtension()
- Gets the file extension for the script source file.
- Returns:
- Script source file extension.
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