com.quadrique.jbuildingblocks.core.interpreter
Class JbbJavaInterpreter

java.lang.Object
  extended by com.quadrique.jbuildingblocks.core.interpreter.JbbJavaInterpreter

public class JbbJavaInterpreter
extends Object

This class is used to manipulate java classes

Version:
1.0.0
Author:
Hervé Rivere

Method Summary
 Object findAndExecuteMethodInScript(String zScriptSourceCode, String zMethodName, Class<?>[] zMethodArgumentsClass, Object[] zMethodArguments)
          RVRV see test code for samples...
 Object findAndExecuteMethodInScript(String zScriptSourceCode, String zMethodName, Class<?>[] zMethodArgumentsClass, Object[] zMethodArguments, bsh.Interpreter zInterpreter)
           
static JbbJavaInterpreter newInstance()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newInstance

public static JbbJavaInterpreter newInstance()
Returns:
a new instance

findAndExecuteMethodInScript

public Object findAndExecuteMethodInScript(String zScriptSourceCode,
                                           String zMethodName,
                                           Class<?>[] zMethodArgumentsClass,
                                           Object[] zMethodArguments)
                                    throws JbbInvalidArgumentException,
                                           JbbScriptEvaluationException,
                                           NoSuchMethodException
RVRV see test code for samples...

Parameters:
zScriptSourceCode - the source code string. It cannot be null or empty
zMethodName - the name of the method to find in the given zSourceCode string and to execute. It cannot be null or empty
zMethodArgumentsClass - an array that contains the class of the arguments of the method to find and execute. zMethodName and zMethodArgumentsClass are used to properly match the desired method signature.
zMethodArguments -
Returns:
object
Throws:
JbbInvalidArgumentException
JbbScriptEvaluationException
NoSuchMethodException

findAndExecuteMethodInScript

public Object findAndExecuteMethodInScript(String zScriptSourceCode,
                                           String zMethodName,
                                           Class<?>[] zMethodArgumentsClass,
                                           Object[] zMethodArguments,
                                           bsh.Interpreter zInterpreter)
                                    throws JbbInvalidArgumentException,
                                           JbbScriptEvaluationException,
                                           NoSuchMethodException
Parameters:
zScriptSourceCode -
zMethodName -
zMethodArgumentsClass -
zMethodArguments -
zInterpreter - to be able to set/get variables in the context before evaluating the script
Returns:
object
Throws:
JbbInvalidArgumentException
JbbScriptEvaluationException
NoSuchMethodException


Copyright © 2001-2008 Quadrique Corporation. All Rights Reserved.