Package bsh
Class ClassGeneratorImpl
- java.lang.Object
-
- bsh.ClassGenerator
-
- bsh.ClassGeneratorImpl
-
public class ClassGeneratorImpl extends ClassGenerator
This class is an implementation of the ClassGenerator interface which contains generally bsh related code. The actual bytecode generation is done by ClassGeneratorUtil.- Author:
- Pat Niemeyer (pat@pat.net)
-
-
Constructor Summary
Constructors Constructor Description ClassGeneratorImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ClassgenerateClass(java.lang.String name, Modifiers modifiers, java.lang.Class[] interfaces, java.lang.Class superClass, bsh.BSHBlock block, boolean isInterface, CallStack callstack, Interpreter interpreter)Parse the BSHBlock for the class definition and generate the class.static java.lang.ClassgenerateClassImpl(java.lang.String name, Modifiers modifiers, java.lang.Class[] interfaces, java.lang.Class superClass, bsh.BSHBlock block, boolean isInterface, CallStack callstack, Interpreter interpreter)If necessary, parse the BSHBlock for for the class definition and generate the class using ClassGeneratorUtil.java.lang.ObjectinvokeSuperclassMethod(BshClassManager bcm, java.lang.Object instance, java.lang.String methodName, java.lang.Object[] args)Invoke a super.method() style superclass method on an object instance.static java.lang.ObjectinvokeSuperclassMethodImpl(BshClassManager bcm, java.lang.Object instance, java.lang.String methodName, java.lang.Object[] args)voidsetInstanceNameSpaceParent(java.lang.Object instance, java.lang.String className, NameSpace parent)Change the parent of the class instance namespace.-
Methods inherited from class bsh.ClassGenerator
getClassGenerator
-
-
-
-
Method Detail
-
generateClass
public java.lang.Class generateClass(java.lang.String name, Modifiers modifiers, java.lang.Class[] interfaces, java.lang.Class superClass, bsh.BSHBlock block, boolean isInterface, CallStack callstack, Interpreter interpreter) throws EvalErrorDescription copied from class:ClassGeneratorParse the BSHBlock for the class definition and generate the class.- Specified by:
generateClassin classClassGenerator- Throws:
EvalError
-
invokeSuperclassMethod
public java.lang.Object invokeSuperclassMethod(BshClassManager bcm, java.lang.Object instance, java.lang.String methodName, java.lang.Object[] args) throws UtilEvalError, bsh.ReflectError, java.lang.reflect.InvocationTargetException
Description copied from class:ClassGeneratorInvoke a super.method() style superclass method on an object instance. This is not a normal function of the Java reflection API and is provided by generated class accessor methods.- Specified by:
invokeSuperclassMethodin classClassGenerator- Throws:
UtilEvalErrorbsh.ReflectErrorjava.lang.reflect.InvocationTargetException
-
setInstanceNameSpaceParent
public void setInstanceNameSpaceParent(java.lang.Object instance, java.lang.String className, NameSpace parent)Change the parent of the class instance namespace. This is currently used for inner class support. Note: This method will likely be removed in the future.- Specified by:
setInstanceNameSpaceParentin classClassGenerator
-
generateClassImpl
public static java.lang.Class generateClassImpl(java.lang.String name, Modifiers modifiers, java.lang.Class[] interfaces, java.lang.Class superClass, bsh.BSHBlock block, boolean isInterface, CallStack callstack, Interpreter interpreter) throws EvalErrorIf necessary, parse the BSHBlock for for the class definition and generate the class using ClassGeneratorUtil. This method also initializes the static block namespace and sets it in the class.- Throws:
EvalError
-
invokeSuperclassMethodImpl
public static java.lang.Object invokeSuperclassMethodImpl(BshClassManager bcm, java.lang.Object instance, java.lang.String methodName, java.lang.Object[] args) throws UtilEvalError, bsh.ReflectError, java.lang.reflect.InvocationTargetException
- Throws:
UtilEvalErrorbsh.ReflectErrorjava.lang.reflect.InvocationTargetException
-
-