Package com.cloudbees.groovy.cps.impl
Class BlockScopeEnv
java.lang.Object
com.cloudbees.groovy.cps.impl.ProxyEnv
com.cloudbees.groovy.cps.impl.BlockScopeEnv
- All Implemented Interfaces:
DepthTrackingEnv,Env,Serializable
Env for a new block.- Author:
- Kohsuke Kawaguchi
- See Also:
-
Field Summary
Fields inherited from interface com.cloudbees.groovy.cps.DepthTrackingEnv
MAX_LEGAL_DEPTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeclareVariable(Class type, String name) Defines a local variable in the current environment.getLocalVariable(String name) Obtains the current value of a local variable in the current environment.getLocalVariableType(String name) voidsetLocalVariable(String name, Object value) Sets the local variable to a new value.Methods inherited from class com.cloudbees.groovy.cps.impl.ProxyEnv
buildStackTraceElements, closureOwner, getBreakAddress, getContinueAddress, getDepth, getExceptionHandler, getInvoker, getReturnAddress
-
Constructor Details
-
BlockScopeEnv
-
BlockScopeEnv
-
-
Method Details
-
declareVariable
Description copied from interface:EnvDefines a local variable in the current environment. This method is called when a variable declaration is encountered.- Specified by:
declareVariablein interfaceEnv- Overrides:
declareVariablein classProxyEnv- Parameters:
type- Type of the local variable.Objectwhen unknown/implicit (e.g. "def x")name- Name of the local variable.- See Also:
-
getLocalVariable
Description copied from interface:EnvObtains the current value of a local variable in the current environment.- Specified by:
getLocalVariablein interfaceEnv- Overrides:
getLocalVariablein classProxyEnv- Parameters:
name- Name of the local variable.- See Also:
-
getLocalVariableType
- Specified by:
getLocalVariableTypein interfaceEnv- Overrides:
getLocalVariableTypein classProxyEnv
-
setLocalVariable
Description copied from interface:EnvSets the local variable to a new value.- Specified by:
setLocalVariablein interfaceEnv- Overrides:
setLocalVariablein classProxyEnv- Parameters:
name- Name of the local variable.value- New value- See Also:
-