Implement getDefaultValue(String.class) for MapWrapper.
This commit is contained in:
parent
aff761a1ec
commit
74a3137577
1 changed files with 7 additions and 0 deletions
|
@ -196,6 +196,13 @@ public class MapWrapper extends ScriptableObject {
|
||||||
return map.keySet().toArray();
|
return map.keySet().toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Object getDefaultValue(Class hint) {
|
||||||
|
if (hint == String.class) {
|
||||||
|
return map == null ? "{}" : map.toString();
|
||||||
|
}
|
||||||
|
return super.getDefaultValue(hint);
|
||||||
|
}
|
||||||
|
|
||||||
public Map unwrap() {
|
public Map unwrap() {
|
||||||
if (map == null) {
|
if (map == null) {
|
||||||
map = new HashMap();
|
map = new HashMap();
|
||||||
|
|
Loading…
Add table
Reference in a new issue