Class Env
java.lang.Object
com.googlecode.aviator.utils.Env
- Type Parameters:
String-Object-
- All Implemented Interfaces:
Serializable, Map<String,Object>
Expression execute environment.Modifed from ChainedMap in jibx.
- Author:
- dennis
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddPackageSymbol(String sym) voidclear()Clear all override key-value pairs.voidconfigure(AviatorEvaluatorInstance instance, Expression exp, long startNs, Env.IntCounter checkPoints) booleancontainsKey(Object key) Check if a key has a defined value.booleancontainsValue(Object value) Check if a value is present.entrySet()Get the set of entries.Remove a key-value pair from overrides.Get value for key.longintbooleanisEmpty()Check if no overrides are defined.keySet()Get the set of keys.Set an override value.Assign an value, if it's already in overrides, it will update it, otherwise set it to default map.voidAdd all key-value pairs from another map into the overrides map.Remove a key-value pair.Class<?> resolveClassSymbol(String name) Class<?> resolveClassSymbol(String name, boolean checkIfAllow) voidsetExpression(Expression expression) voidsetInstance(AviatorEvaluatorInstance instance) voidsetmOverrides(Map<String, Object> mOverrides) intsize()Get the number of entries in the map.toString()Gets the map as a String.values()Get the values.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
EMPTY_ENV
-
-
Constructor Details
-
Env
public Env()Constructs an env instance with empty state. -
Env
-
Env
-
-
Method Details
-
setmOverrides
-
getStartNs
public long getStartNs() -
incExecCheckpointsAndGet
public int incExecCheckpointsAndGet() -
getCheckPoints
-
getImportedSymbols
-
getExpression
-
setExpression
-
getDefaults
-
addSymbol
-
addPackageSymbol
-
getInstance
-
setInstance
-
configure
public void configure(AviatorEvaluatorInstance instance, Expression exp, long startNs, Env.IntCounter checkPoints) -
resolveClassSymbol
- Throws:
ClassNotFoundException
-
resolveClassSymbol
- Throws:
ClassNotFoundException
-
clear
-
containsKey
Check if a key has a defined value. This will returntrueif the key is present in the overrides map or the defaults map.- Specified by:
containsKeyin interfaceMap<String,Object> - Parameters:
key-- Returns:
trueif key defined,falseif not
-
containsValue
Check if a value is present.- Specified by:
containsValuein interfaceMap<String,Object> - Parameters:
value-- Returns:
trueif value present as an override,falseif not
-
entrySet
-
get
Get value for key. If the key is present in the overrides map, the value from that map is returned; otherwise, the value for the key in the defaults map is returned. -
isEmpty
-
keySet
-
override
-
put
-
putAll
-
remove
Remove a key-value pair. If the key was previously present in the overrides map it is simply removed from that map. If it was not present in the overrides map but is present in the defaults map, a null entry is added to the overrides map for that key. -
forgot
-
size
-
values
-
toString
-