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()
InterpreterHook
init
in interface InterpreterHook
public void setNext(InterpreterHook next)
InterpreterHook
setNext
in interface InterpreterHook
next
- the next element in the chain.public void setInterpreter(ExtendedInterpreter interpreter)
InterpreterHook
setInterpreter
in interface InterpreterHook
public void beforeExecute(Command command)
InterpreterHook
beforeExecute
in interface InterpreterHook
command
- the command object to be executedpublic void afterExecute(Command command)
InterpreterHook
afterExecute
in interface InterpreterHook
command
- the command just executed.public void beforeRegisteringJavaMethod(String alias, Class<?> klass, String methodName, Class<?>[] argumentTypes)
InterpreterHook
beforeRegisteringJavaMethod
in interface InterpreterHook
alias
- 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 InterpreterHook
public void afterPush(Command command)
afterPush
in interface InterpreterHook
public void beforePop()
beforePop
in interface InterpreterHook
public void afterPop(Command command)
afterPop
in interface InterpreterHook
public void setReturnValue(RightValue returnValue)
InterpreterHook
ExtendedInterpreter.disableHook()
and ExtendedInterpreter.enableHook()
.setReturnValue
in interface InterpreterHook
ExtendedInterpreter.disableHook()
public void beforeSubroutineCall(String subroutineName, LeftValueList arguments, RightValue[] argumentValues)
InterpreterHook
beforeSubroutineCall
in interface InterpreterHook
subroutineName
- 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 InterpreterHook
public Object afterCallJavaFunction(Method method, Object result)
InterpreterHook
afterCallJavaFunction
in interface InterpreterHook
method
- the method that was calledresult
- the result that the static method returnedpublic RightValue variableRead(String variableName, RightValue value)
InterpreterHook
variableRead
in interface InterpreterHook
variableName
- the name of the variablevalue
- the value of the variable when accessedCopyright © 2013 Verhas and Verhas Software Craftsmen. All Rights Reserved.