public class MvelBindings
extends java.lang.Object
implements javax.script.Bindings
| Modifier and Type | Field and Description |
|---|---|
private java.util.Map<java.lang.String,java.lang.Object> |
map
The
Map field stores the attributes. |
| Constructor and Description |
|---|
MvelBindings()
Default constructor uses a
HashMap. |
MvelBindings(java.util.Map<java.lang.String,java.lang.Object> m)
Constructor uses an existing
Map to store the values. |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
boolean |
containsKey(java.lang.Object key)
Returns true if this map contains a mapping for the specified 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)
Returns the value to which this map maps the specified key.
|
boolean |
isEmpty() |
java.util.Set<java.lang.String> |
keySet() |
java.lang.Object |
put(java.lang.String name,
java.lang.Object value)
Sets the specified key/value in the underlying
map field. |
void |
putAll(java.util.Map<? extends java.lang.String,? extends java.lang.Object> toMerge)
putAll is implemented using Map.putAll. |
java.lang.Object |
remove(java.lang.Object key)
Removes the mapping for this key from this map if it is present (optional operation).
|
int |
size() |
java.util.Collection<java.lang.Object> |
values() |
private java.util.Map<java.lang.String,java.lang.Object> map
Map field stores the attributes.public MvelBindings(java.util.Map<java.lang.String,java.lang.Object> m)
Map to store the values.m - The Map backing this SimpleBindings.java.lang.NullPointerException - if m is nullpublic MvelBindings()
HashMap.public java.lang.Object put(java.lang.String name,
java.lang.Object value)
map field.put in interface java.util.Map<java.lang.String,java.lang.Object>put in interface javax.script.Bindingsname - Name of valuevalue - Value to set.java.lang.NullPointerException - if the name is null.java.lang.IllegalArgumentException - if the name is empty.public void putAll(java.util.Map<? extends java.lang.String,? extends java.lang.Object> toMerge)
putAll is implemented using Map.putAll.putAll in interface java.util.Map<java.lang.String,java.lang.Object>putAll in interface javax.script.BindingstoMerge - The Map of values to add.java.lang.NullPointerException - if toMerge map is null or if some key in the map is null.java.lang.IllegalArgumentException - if some key in the map is an empty String.public void clear()
clear in interface java.util.Map<java.lang.String,java.lang.Object>public boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<java.lang.String,java.lang.Object>containsKey in interface javax.script.Bindingskey - key whose presence in this map is to be tested.java.lang.NullPointerException - if key is nulljava.lang.ClassCastException - if key is not Stringjava.lang.IllegalArgumentException - if key is empty Stringpublic boolean containsValue(java.lang.Object value)
containsValue 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>public java.lang.Object get(java.lang.Object key)
More formally, if this map contains a mapping from a key k to a value v such that (key==null ? k==null : key.equals(k)), then this method returns v; otherwise it returns null. (There can be at most one such mapping.)
get in interface java.util.Map<java.lang.String,java.lang.Object>get in interface javax.script.Bindingskey - key whose associated value is to be returned.java.lang.NullPointerException - if key is nulljava.lang.ClassCastException - if key is not Stringjava.lang.IllegalArgumentException - if key is empty Stringpublic boolean isEmpty()
isEmpty 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.lang.Object remove(java.lang.Object key)
(key==null ? k==null : key.equals(k)), that mapping is removed. (The map can
contain at most one such mapping.)
Returns the value to which the map previously associated the key, or null if the map contained no mapping for this key. (A null return can also indicate that the map previously associated null with the specified key if the implementation supports null values.) The map will not contain a mapping for the specified key once the call returns.
remove in interface java.util.Map<java.lang.String,java.lang.Object>remove in interface javax.script.Bindingskey - key whose mapping is to be removed from the map.java.lang.NullPointerException - if key is nulljava.lang.ClassCastException - if key is not Stringjava.lang.IllegalArgumentException - if key is empty Stringpublic int size()
size 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>