public class ParametersCallbackMap extends java.lang.Object implements ParametersCallback, java.util.Map<java.lang.String,java.lang.Object>
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.
Constructor and Description |
---|
ParametersCallbackMap(ParametersCallback parentParameters)
Initializes instance and set parent parameters to use in
getParameter(String) . |
ParametersCallbackMap(ParametersCallback parentParameters,
QueryCallback queryCallback)
Initializes parameters callback for query element.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears local variables.
|
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> |
entrySet() |
java.lang.Object |
get(java.lang.Object key)
Use
getParameter(String) . |
java.lang.Object |
getParameter(java.lang.String name)
Returns specified variable value.
|
boolean |
isEmpty() |
boolean |
isNextCalled()
CRQ-12257.
|
java.util.Set<java.lang.String> |
keySet() |
void |
next()
Executes nested elements and exposes local variables set by the current query.
|
java.lang.Object |
put(java.lang.String key,
java.lang.Object value)
Sets local variable.
|
void |
putAll(java.util.Map<? extends java.lang.String,?> t)
Registers local variables.
|
java.lang.Object |
remove(java.lang.Object key)
Removes local variable.
|
void |
setQueryCallback(QueryCallback queryCallback)
Sets query callback and enables the query mode, i.e.
|
int |
size() |
java.util.Collection<java.lang.Object> |
values() |
public ParametersCallbackMap(ParametersCallback parentParameters)
getParameter(String)
.parentParameters
- parent parameters.public ParametersCallbackMap(ParametersCallback parentParameters, QueryCallback queryCallback)
parentParameters
- parent parameters.queryCallback
- callback to notify on row iteration.public java.lang.Object getParameter(java.lang.String name)
The local variables set by put(String,Object)
method
take priority of variables in parentParameters object.
getParameter
in interface ParametersCallback
name
- variable namepublic java.lang.Object get(java.lang.Object key)
getParameter(String)
.get
in interface java.util.Map<java.lang.String,java.lang.Object>
key
- variable name.public boolean containsKey(java.lang.Object key)
containsKey
in interface java.util.Map<java.lang.String,java.lang.Object>
public java.lang.Object put(java.lang.String key, java.lang.Object value)
put
in interface java.util.Map<java.lang.String,java.lang.Object>
key
- variable name.value
- variable value.public java.lang.Object remove(java.lang.Object key)
remove
in interface java.util.Map<java.lang.String,java.lang.Object>
key
- variable name.public void putAll(java.util.Map<? extends java.lang.String,?> t)
putAll
in interface java.util.Map<java.lang.String,java.lang.Object>
t
- local variables map.public void clear()
clear
in interface java.util.Map<java.lang.String,java.lang.Object>
public void setQueryCallback(QueryCallback queryCallback)
queryCallback
- query callback.public void next()
public boolean isNextCalled()
public int size()
size
in interface java.util.Map<java.lang.String,java.lang.Object>
public boolean isEmpty()
isEmpty
in interface java.util.Map<java.lang.String,java.lang.Object>
public boolean containsValue(java.lang.Object value)
containsValue
in interface java.util.Map<java.lang.String,java.lang.Object>
public java.util.Set<java.lang.String> keySet()
keySet
in interface java.util.Map<java.lang.String,java.lang.Object>
public java.util.Collection<java.lang.Object> values()
values
in interface java.util.Map<java.lang.String,java.lang.Object>
public java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> entrySet()
entrySet
in interface java.util.Map<java.lang.String,java.lang.Object>
Copyright © Copyright 2006-2019 The Scriptella Project Team.