public class NullHook extends Object implements InterpreterHook
This hook is used to chain into the hook chain first so that hook classes need not check if there is a next hook object in the chain.
| Constructor and Description |
|---|
NullHook() |
| Modifier and Type | Method and Description |
|---|---|
Object |
afterCallJavaFunction(Method method,
Object result)
This method is called when the interpreter was calling a Java static
method.
|
void |
afterExecute(Command command)
This method is called after the interpreter executed a command.
|
void |
afterPop(Command command) |
void |
afterPush(Command command) |
void |
beforeCallJavaFunction(Method method) |
void |
beforeExecute(Command command)
This method is called before the interpreter executes a command.
|
void |
beforePop() |
void |
beforePush(Command command) |
void |
beforeRegisteringJavaMethod(String alias,
Class<?> klass,
String methodName,
Class<?>[] argumentTypes)
This method is called before registering a java method into the
interpreter.
|
void |
beforeSubroutineCall(String subroutineName,
LeftValueList arguments,
RightValue[] argumentValues)
This method is called before the interpreter invokes a subroutine.
|
void |
init()
This method is called at the end of the hook registering.
|
void |
setInterpreter(ExtendedInterpreter interpreter)
During registration the interpreter calls this method to make the
interpreter accessible for the hook objects.
|
void |
setNext(InterpreterHook next)
When a hook is registered the registering process calls this method and
passes the next element in the hook chain.
|
void |
setReturnValue(RightValue returnValue)
This method is called after a subroutine has set its return value.
|
RightValue |
variableRead(String variableName,
RightValue value)
This hook is called when the interpreter accesses a variable.
|
public void init()
InterpreterHookinit in interface InterpreterHookpublic void setNext(InterpreterHook next)
InterpreterHooksetNext in interface InterpreterHooknext - the next element in the chain.public void setInterpreter(ExtendedInterpreter interpreter)
InterpreterHooksetInterpreter in interface InterpreterHookpublic void beforeExecute(Command command)
InterpreterHookbeforeExecute in interface InterpreterHookcommand - the command object to be executedpublic void afterExecute(Command command)
InterpreterHookafterExecute in interface InterpreterHookcommand - the command just executed.public void beforeRegisteringJavaMethod(String alias, Class<?> klass, String methodName, Class<?>[] argumentTypes)
InterpreterHookbeforeRegisteringJavaMethod in interface InterpreterHookalias - the name of the function as it will be known to the BASIC
program.klass - the Java class where the static method is.methodName - the Java name of the methodargumentTypes - the argument types of the methods. This, together with the
name of the method and the class identifies the actual method
that will be available to the BASIC programs to be called
through the name alias.public void beforePush(Command command)
beforePush in interface InterpreterHookpublic void afterPush(Command command)
afterPush in interface InterpreterHookpublic void beforePop()
beforePop in interface InterpreterHookpublic void afterPop(Command command)
afterPop in interface InterpreterHookpublic void setReturnValue(RightValue returnValue)
InterpreterHookExtendedInterpreter.disableHook() and ExtendedInterpreter.enableHook().setReturnValue in interface InterpreterHookExtendedInterpreter.disableHook()public void beforeSubroutineCall(String subroutineName, LeftValueList arguments, RightValue[] argumentValues)
InterpreterHookbeforeSubroutineCall in interface InterpreterHooksubroutineName - the symbolic name of the subroutinearguments - the argument left valuesargumentValues - the argument evaluated values that were assigned to the local
variable table to the argumentspublic void beforeCallJavaFunction(Method method)
beforeCallJavaFunction in interface InterpreterHookpublic Object afterCallJavaFunction(Method method, Object result)
InterpreterHookafterCallJavaFunction in interface InterpreterHookmethod - the method that was calledresult - the result that the static method returnedpublic RightValue variableRead(String variableName, RightValue value)
InterpreterHookvariableRead in interface InterpreterHookvariableName - the name of the variablevalue - the value of the variable when accessedCopyright © 2013 Verhas and Verhas Software Craftsmen. All Rights Reserved.