public class JsObjMap extends OrderedMap<String,Object> implements JsCollection
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
JsObjMap() |
JsObjMap(CharSequence inJSONString) |
JsObjMap(int inInitialCapacity) |
JsObjMap(int inInitialCapacity,
float inLoadFactor) |
JsObjMap(Map<String,Object> inMap) |
Modifier and Type | Method and Description |
---|---|
String |
getString(String inKey) |
Object |
put(String inKey,
Collection inValues) |
Object |
put(String inKey,
JsArray inValue) |
Object |
put(String inKey,
Object inValue) |
Object |
put(String inKey,
Object[] inValues) |
void |
putUnquoted(String inKey,
Object inValue)
Puts the specified key / value pair into the map but does not quote the
value when calling toJavascript() [Note that not quoting a string value means
that the resulting serialization will no longer be valid JSON, but sending
function definitions in a JSON-like format can be useful when working with
javascript frameworks].
|
Object |
remove(Object inKey) |
String |
toJavascript()
Produces a javascript serialization that will generally be the same as produced
by toJSON() except when values have been added via the putUnquoted() method.
|
void |
toJavascript(OutputStream inStream)
Produces a javascript serialization that will generally be the same as produced
by toJSON() except when values have been added via the putUnquoted() method.
|
void |
toJavascript(Writer inWriter)
Produces a javascript serialization that will generally be the same as produced
by toJSON() except when values have been added via the putUnquoted() method.
|
String |
toJSON()
Produces a JSON serialization of the Collection.
|
void |
toJSON(OutputStream inStream) |
void |
toJSON(Writer inWriter)
Produces a JSON serialization of the Collection.
|
String |
toString() |
clear, compute, computeIfAbsent, computeIfPresent, entrySet, forEach, keySet, merge, putAll, putIfAbsent, values
clone, containsKey, containsValue, get, getOrDefault, isEmpty, remove, replace, replace, replaceAll, size
equals, hashCode
public JsObjMap()
public JsObjMap(int inInitialCapacity)
public JsObjMap(int inInitialCapacity, float inLoadFactor)
public JsObjMap(CharSequence inJSONString)
public String toJSON()
JsCollection
toJSON
in interface JsCollection
public void toJSON(OutputStream inStream)
public void toJSON(Writer inWriter)
JsCollection
toJSON
in interface JsCollection
inWriter
- where to send the JSON topublic String toJavascript()
toJavascript
in interface JsCollection
public void toJavascript(OutputStream inStream)
public void toJavascript(Writer inWriter)
toJavascript
in interface JsCollection
inWriter
- where to send the javascript topublic void putUnquoted(String inKey, Object inValue)
public Object put(String inKey, Collection inValues)