Class NullHook

java.lang.Object
com.scriptbasic.hooks.NullHook
All Implemented Interfaces:
InterpreterHook

public class NullHook extends Object implements InterpreterHook
The simplest implementation of the InterfaceHook interface. This implements each of the methods of the interface, each doing nothing.

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.

Author:
Peter Verhas date Aug 15, 2012
  • Constructor Details

    • NullHook

      public NullHook()
  • Method Details

    • setNext

      public void setNext(InterpreterHook next)
      Description copied from interface: InterpreterHook
      When a hook is registered the registering process calls this method and passes the next element in the hook chain. The hook object should remember this object and call the appropriate methods when that is called not to break the chain.
      Specified by:
      setNext in interface InterpreterHook
      Parameters:
      next - the next element in the chain.
    • setInterpreter

      public void setInterpreter(Interpreter interpreter)
      Description copied from interface: InterpreterHook
      During registration the interpreter calls this method to make the interpreter accessible for the hook objects.
      Specified by:
      setInterpreter in interface InterpreterHook
      Parameters:
      interpreter - parameter