Interface IIvyScriptContext
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Object
getObject(String name)
Gets the value of a variable from the context.Object
getObjectInitialized(String name)
Gets the value of a variable from the context.Object
getObjectOrNull(String name)
Gets the value of a variable from the context.List<String>
getVariableNames()
Gets all variable namesboolean
hasVariable(String name)
Decides whether a variable is declared.
-
-
-
Method Detail
-
getObject
Object getObject(String name) throws IvyScriptVariableNotFoundException
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
Object getObjectOrNull(String name)
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
List<String> getVariableNames()
Gets all variable names- Returns:
- variable names
- API:
- This public API is available in Java.
-
hasVariable
boolean hasVariable(String name)
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.
-
-