Class BaseInterceptor

java.lang.Object
ortus.boxlang.runtime.events.BaseInterceptor
All Implemented Interfaces:
IInterceptor
Direct Known Subclasses:
ASTCapture, Logging

public abstract class BaseInterceptor extends Object implements IInterceptor
An abstract base class for interceptors with many helper methods useful during interceptions
  • Field Details

    • properties

      protected IStruct properties
      The properties to configure the interceptor with (if any)
    • logger

      protected org.slf4j.Logger logger
      A logger class
  • Constructor Details

    • BaseInterceptor

      public BaseInterceptor()
  • Method Details

    • configure

      public void configure(IStruct properties)
      This method is called by the BoxLang runtime to configure the interceptor with a Struct of properties
      Specified by:
      configure in interface IInterceptor
      Parameters:
      properties - The properties to configure the interceptor with (if any)
    • configure

      public void configure()
      This method is called by the BoxLang runtime to configure the interceptor
      Specified by:
      configure in interface IInterceptor
    • getProperties

      public IStruct getProperties()
      Get the properties
      Returns:
      The properties
    • getProperty

      public Object getProperty(Key name)
      Get a property
      Parameters:
      name - The property name
      Returns:
      The property value or null if not found
    • getProperty

      public Object getProperty(Key name, Object defaultValue)
      Get a property or a default value
      Parameters:
      name - The property name
      defaultValue - The default value
      Returns:
      The property value or the default value if not found
    • hasProperty

      public boolean hasProperty(Key name)
      Verify if a property exists
      Parameters:
      name - The property name
      Returns:
      True if the property exists, false otherwise
    • setProperty

      public IInterceptor setProperty(Key name, Object value)
      Set a property
      Parameters:
      name - The property name
      value - The property value
    • getLogger

      public org.slf4j.Logger getLogger()
      Get the logger
      Returns:
      The logger
    • getRuntime

      public BoxRuntime getRuntime()
      Get the runtime
      Returns:
      The runtime
    • unregister

      public void unregister()
      Unregister the interceptor from all states