Interface IIvyScriptContext
- All Superinterfaces:
Cloneable
This class represents a context to execute instructions.
It does this at the moment just by providing some local
objects which each has a name.
- API:
- This is a public API.
-
Method Summary
Modifier and TypeMethodDescriptionGets the value of a variable from the context.getObjectInitialized
(String name) Gets the value of a variable from the context.getObjectOrNull
(String name) Gets the value of a variable from the context.Gets all variable namesboolean
hasVariable
(String name) Decides whether a variable is declared.
-
Method Details
-
getObject
Gets the value of a variable from the context. If the variable is not declared in this context tries the outer context.- Parameters:
name
- The name of the object to find.- Returns:
- The value of the variable.
- Throws:
IvyScriptVariableNotFoundException
- An exception is thrown if the variable is not declared.- API:
- This public API is available in Java.
-
getObjectInitialized
Object getObjectInitialized(String name) throws IvyScriptInitializationException, IvyScriptVariableNotFoundException Gets the value of a variable from the context. If the variable is not declared in this context tries the outer context. If the value is not initialized, it becomes initialzed with the default constructor.- Parameters:
name
- The name of the object to find.- Returns:
- The value of the variable.
- Throws:
IvyScriptInitializationException
- if variable cannot be initializedIvyScriptVariableNotFoundException
- An exception is thrown if the variable is not declared.- API:
- This public API is available in Java.
-
getObjectOrNull
Gets the value of a variable from the context. If the variable is not declared in this context tries the outer context. If the variable is not defined at all returns null.- Parameters:
name
- The name of the object to find.- Returns:
- The value of the variable or null if variable is not defined.
- API:
- This public API is available in Java.
-
getVariableNames
Gets all variable names- Returns:
- variable names
- API:
- This public API is available in Java.
-
hasVariable
Decides whether a variable is declared.- Parameters:
name
-- Returns:
- true if given variable is declared, false otherwise.
- API:
- This public API is available in Java.
-