Package scriptella.driver.script
Class ParametersCallbackMap
java.lang.Object
scriptella.driver.script.ParametersCallbackMap
- All Implemented Interfaces:
Map<String,,Object> ParametersCallback
- Direct Known Subclasses:
BindingsParametersCallback
Map implementation of ParametersCallback for
integration into Scriptella execution environment.
This class allows local variables to be set via put(String,Object) method.
getParameter(String) allows reading variables.
In query mode, a virtual variable query is available and exposes a method
next() to populate result set.
Note: current implementation does not distinguish if a variable is absent or has a value of null.
- Version:
- 1.0
- Author:
- Fyodor Kupolov
-
Nested Class Summary
-
Constructor Summary
ConstructorsConstructorDescriptionParametersCallbackMap(ParametersCallback parentParameters) Initializes instance and set parent parameters to use ingetParameter(String).ParametersCallbackMap(ParametersCallback parentParameters, QueryCallback queryCallback) Initializes parameters callback for query element. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears local variables.booleancontainsKey(Object key) booleancontainsValue(Object value) entrySet()UsegetParameter(String).getParameter(String name) Returns specified variable value.booleanisEmpty()booleanCRQ-12257.keySet()voidnext()Executes nested elements and exposes local variables set by the current query.Sets local variable.voidRegisters local variables.Removes local variable.voidsetQueryCallback(QueryCallback queryCallback) Sets query callback and enables the query mode, i.e.intsize()values()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
ParametersCallbackMap
Initializes instance and set parent parameters to use ingetParameter(String).- Parameters:
parentParameters- parent parameters.
-
ParametersCallbackMap
Initializes parameters callback for query element.- Parameters:
parentParameters- parent parameters.queryCallback- callback to notify on row iteration.
-
-
Method Details
-
getParameter
Returns specified variable value.The local variables set by
put(String,Object)method take priority of variables in parentParameters object.- Specified by:
getParameterin interfaceParametersCallback- Parameters:
name- variable name- Returns:
- value of variable or null if variable not found.
-
get
UsegetParameter(String). -
containsKey
- Specified by:
containsKeyin interfaceMap<String,Object>
-
put
Sets local variable. -
remove
Removes local variable. -
putAll
Registers local variables. -
clear
public void clear()Clears local variables. -
setQueryCallback
Sets query callback and enables the query mode, i.e. query variable is exposed.- Parameters:
queryCallback- query callback.
-
next
public void next()Executes nested elements and exposes local variables set by the current query. -
isNextCalled
public boolean isNextCalled()CRQ-12257. Returns true if next was called on this query.- Returns:
- true if next was called on this query.
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsValue
- Specified by:
containsValuein interfaceMap<String,Object>
-
keySet
-
values
-
entrySet
-