public class JsObjMap extends OrderedMap<java.lang.String,java.lang.Object> implements JsCollection
Constructor and Description |
---|
JsObjMap() |
JsObjMap(java.lang.CharSequence inJSONString) |
JsObjMap(int inInitialCapacity) |
JsObjMap(int inInitialCapacity,
float inLoadFactor) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getString(java.lang.String inKey) |
java.lang.Object |
put(java.lang.String inKey,
java.util.Collection inValues) |
java.lang.Object |
put(java.lang.String inKey,
JsArray inValue) |
java.lang.Object |
put(java.lang.String inKey,
java.lang.Object inValue) |
java.lang.Object |
put(java.lang.String inKey,
java.lang.Object[] inValues) |
void |
putUnquoted(java.lang.String inKey,
java.lang.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].
|
java.lang.Object |
remove(java.lang.Object inKey) |
java.lang.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(java.io.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(java.io.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.
|
java.lang.String |
toJSON()
Produces a JSON serialization of the Collection.
|
void |
toJSON(java.io.OutputStream inStream) |
void |
toJSON(java.io.Writer inWriter)
Produces a JSON serialization of the Collection.
|
java.lang.String |
toString() |
clear, compute, computeIfAbsent, computeIfPresent, entrySet, forEach, keySet, merge, putAll, putIfAbsent, values
clone, containsKey, containsValue, get, getOrDefault, isEmpty, remove, replace, replace, replaceAll, size
public JsObjMap()
public JsObjMap(int inInitialCapacity)
public JsObjMap(int inInitialCapacity, float inLoadFactor)
public JsObjMap(java.lang.CharSequence inJSONString)
public java.lang.String toString()
toString
in class java.util.AbstractMap<java.lang.String,java.lang.Object>
public java.lang.String toJSON()
JsCollection
toJSON
in interface JsCollection
public void toJSON(java.io.OutputStream inStream)
public void toJSON(java.io.Writer inWriter)
JsCollection
toJSON
in interface JsCollection
inWriter
- where to send the JSON topublic java.lang.String toJavascript()
toJavascript
in interface JsCollection
public void toJavascript(java.io.OutputStream inStream)
public void toJavascript(java.io.Writer inWriter)
toJavascript
in interface JsCollection
inWriter
- where to send the javascript topublic java.lang.String getString(java.lang.String inKey)
public void putUnquoted(java.lang.String inKey, java.lang.Object inValue)
public java.lang.Object put(java.lang.String inKey, java.lang.Object inValue)
put
in interface java.util.Map<java.lang.String,java.lang.Object>
put
in class OrderedMap<java.lang.String,java.lang.Object>
public java.lang.Object put(java.lang.String inKey, java.util.Collection inValues)
public java.lang.Object put(java.lang.String inKey, java.lang.Object[] inValues)
public java.lang.Object remove(java.lang.Object inKey)
remove
in interface java.util.Map<java.lang.String,java.lang.Object>
remove
in class OrderedMap<java.lang.String,java.lang.Object>
[email protected]