Package ortus.boxlang.runtime.context
Class InterfaceBoxContext
java.lang.Object
ortus.boxlang.runtime.context.BaseBoxContext
ortus.boxlang.runtime.context.InterfaceBoxContext
- All Implemented Interfaces:
Serializable
,IBoxContext
,IBoxAttachable
This context represents the initialization of an interface, and is really only here for the registerUDF method
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface ortus.boxlang.runtime.context.IBoxContext
IBoxContext.ScopeSearchResult
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StaticScope
protected BoxInterface
The interface instanceFields inherited from class ortus.boxlang.runtime.context.BaseBoxContext
buffers, components, currentImports, nullIsUndefined, parent, queryLoops, templates
-
Constructor Summary
ConstructorsConstructorDescriptionInterfaceBoxContext
(IBoxContext parent, BoxInterface thisInterface) Creates a new execution context with a bounded function instance and parent context -
Method Summary
Modifier and TypeMethodDescriptionGet the default variable assignment scope for this contextGet parent context for a function execution happening in this contextLook for a scope by namegetScopeNearby
(Key name, boolean shallow) Look for a "nearby" scope by namegetVisibleScopes
(IStruct scopes, boolean nearby, boolean shallow) This is mostly for the debugger.void
registerUDF
(UDF udf, boolean override) Register a UDF with the local context choosing to override.Search for a variable in scopesscopeFindNearby
(Key key, IScope defaultScope, boolean shallow, boolean forAssign) Search for a variable in "nearby" scopesMethods inherited from class ortus.boxlang.runtime.context.BaseBoxContext
canOutput, clearBuffer, computeAttachmentIfAbsent, findBaseTemplate, findBIF, findClosestComponent, findClosestComponent, findClosestFunctionName, findClosestTemplate, findFunction, flushBuffer, getApplicationContext, getAttachment, getAttachmentKeys, getBuffer, getComponents, getConfig, getConfigItem, getConfigItem, getConfigItems, getCurrentImports, getFunctionClass, getFunctionInterface, getFunctionStaticClass, getLogger, getModuleRecord, getModuleSettings, getParent, getParentOfType, getQueryRow, getRequestContext, getRuntime, getScopeNearby, getTemplates, getVisibleScopes, hasAttachment, hasParent, hasTemplates, includeTemplate, incrementQueryLoop, injectParentContext, injectTopParentContext, invokeComponent, invokeFunction, invokeFunction, invokeFunction, invokeFunction, invokeFunction, invokeFunction, invokeFunction, invokeFunction, isDefined, navigateConfig, popBuffer, popComponent, popTemplate, pushBuffer, pushComponent, pushTemplate, pushTemplate, putAttachment, queryFindNearby, registerQueryLoop, registerUDF, removeAttachment, removeParentContext, rethrow, scopeFindNearby, setParent, unregisterQueryLoop, unwrapQueryColumn, writeToBuffer, writeToBuffer
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ortus.boxlang.runtime.context.IBoxContext
getApplicationCache, getApplicationName, registerUDF, shutdown, startup
-
Field Details
-
thisInterface
The interface instance -
staticScope
-
-
Constructor Details
-
InterfaceBoxContext
Creates a new execution context with a bounded function instance and parent context- Parameters:
parent
- The parent contextthisInterface
- The target interface
-
-
Method Details
-
getVisibleScopes
Description copied from class:BaseBoxContext
This is mostly for the debugger. It returns all visible scopes from this context.- Specified by:
getVisibleScopes
in interfaceIBoxContext
- Overrides:
getVisibleScopes
in classBaseBoxContext
- Returns:
- A struct containing all contextual and lexically visible scopes
-
scopeFindNearby
public IBoxContext.ScopeSearchResult scopeFindNearby(Key key, IScope defaultScope, boolean shallow, boolean forAssign) Search for a variable in "nearby" scopes- Specified by:
scopeFindNearby
in interfaceIBoxContext
- Overrides:
scopeFindNearby
in classBaseBoxContext
- Parameters:
key
- The key to search fordefaultScope
- The default scope to use if the key is not foundshallow
- Whether to search only the "nearby" scopes or all scopesforAssign
- true, this is for an assignment operation- Returns:
- The search result
-
scopeFind
Search for a variable in scopes- Specified by:
scopeFind
in interfaceIBoxContext
- Overrides:
scopeFind
in classBaseBoxContext
- Parameters:
key
- The key to search fordefaultScope
- The default scope to use if the key is not foundforAssign
- true, this is for an assignment operation- Returns:
- The search result
-
getScope
Look for a scope by name- Specified by:
getScope
in interfaceIBoxContext
- Overrides:
getScope
in classBaseBoxContext
- Parameters:
name
- The name of the scope to look for- Returns:
- The scope reference to use
- Throws:
ScopeNotFoundException
- If the scope was not found in any context
-
getScopeNearby
Look for a "nearby" scope by name- Specified by:
getScopeNearby
in interfaceIBoxContext
- Overrides:
getScopeNearby
in classBaseBoxContext
- Parameters:
name
- The name of the scope to look forshallow
- true, do not delegate to parent or default scope if not found- Returns:
- The scope reference to use
- Throws:
ScopeNotFoundException
- If the scope was not found in any context
-
registerUDF
Description copied from class:BaseBoxContext
Register a UDF with the local context choosing to override.- Specified by:
registerUDF
in interfaceIBoxContext
- Overrides:
registerUDF
in classBaseBoxContext
- Parameters:
udf
- The UDF to registeroverride
- true, override any existing UDF with the same name
-
getDefaultAssignmentScope
Get the default variable assignment scope for this context- Specified by:
getDefaultAssignmentScope
in interfaceIBoxContext
- Overrides:
getDefaultAssignmentScope
in classBaseBoxContext
- Returns:
- The scope reference to use
-
getFunctionParentContext
Get parent context for a function execution happening in this context- Specified by:
getFunctionParentContext
in interfaceIBoxContext
- Overrides:
getFunctionParentContext
in classBaseBoxContext
- Returns:
- The context to use
-