Package ortus.boxlang.runtime.events
Class BaseInterceptor
java.lang.Object
ortus.boxlang.runtime.events.BaseInterceptor
- All Implemented Interfaces:
IInterceptor
- Direct Known Subclasses:
ASTCapture
,Logging
An abstract base class for interceptors with many helper methods useful during interceptions
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.slf4j.Logger
A logger classprotected IStruct
The properties to configure the interceptor with (if any) -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
This method is called by the BoxLang runtime to configure the interceptorvoid
This method is called by the BoxLang runtime to configure the interceptor with a Struct of propertiesorg.slf4j.Logger
Get the loggerGet the propertiesgetProperty
(Key name) Get a propertygetProperty
(Key name, Object defaultValue) Get a property or a default valueGet the runtimeboolean
hasProperty
(Key name) Verify if a property existssetProperty
(Key name, Object value) Set a propertyvoid
Unregister the interceptor from all states
-
Field Details
-
properties
The properties to configure the interceptor with (if any) -
logger
protected org.slf4j.Logger loggerA logger class
-
-
Constructor Details
-
BaseInterceptor
public BaseInterceptor()
-
-
Method Details
-
configure
This method is called by the BoxLang runtime to configure the interceptor with a Struct of properties- Specified by:
configure
in interfaceIInterceptor
- 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 interfaceIInterceptor
-
getProperties
Get the properties- Returns:
- The properties
-
getProperty
Get a property- Parameters:
name
- The property name- Returns:
- The property value or null if not found
-
getProperty
Get a property or a default value- Parameters:
name
- The property namedefaultValue
- The default value- Returns:
- The property value or the default value if not found
-
hasProperty
Verify if a property exists- Parameters:
name
- The property name- Returns:
- True if the property exists, false otherwise
-
setProperty
Set a property- Parameters:
name
- The property namevalue
- The property value
-
getLogger
public org.slf4j.Logger getLogger()Get the logger- Returns:
- The logger
-
getRuntime
Get the runtime- Returns:
- The runtime
-
unregister
public void unregister()Unregister the interceptor from all states
-