java.lang.Object | |
↳ | com.microstrategy.utils.GenericJsonGenerator |
![]() |
This class generates JavaScript Object Notation strings (JSON)
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
GenericJsonGenerator()
The default, no args constructor.
| |||||||||||
GenericJsonGenerator(Comparator<String> keyComparator)
A constructor that passes in a Comparator to use for sorting properties.
| |||||||||||
GenericJsonGenerator(boolean preserveOrder)
A constructor used if caller needs the properties insertion order to be preserved
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static String | applyGenericEncoding(String data) | ||||||||||
Set<String> | getKeys() | ||||||||||
void |
serializeInto(StringBuilder stringBuilder)
Serialize the contents of this object into the supplied StringBuilder,
growing it first, as necessary, to accommodate the serialized form.
| ||||||||||
void |
setBeanPaths(WebComponent wc, int[] events)
Sets bean paths as properties of this Json
| ||||||||||
void | setEncoderChain(ContentEncoderChain encoderChain) | ||||||||||
void |
setJSObjectProperty(String propName, String propValue)
This method adds a JavaScript Object property to the bone
| ||||||||||
void |
setProperty(String propName, String propValue)
This method adds a String property to the bone
| ||||||||||
void |
setProperty(String propName, String propValue, boolean quote)
This method adds a String property to the bone
| ||||||||||
void |
setProperty(String propName, double propValue)
This method adds a double property to the bone
| ||||||||||
void |
setProperty(String propName, float propValue)
This method adds a float property to the bone
| ||||||||||
void |
setProperty(String propName, GenericJsonGenerator propValue)
This method adds a JSON property to the bone
| ||||||||||
void | setProperty(String propName, GenericJsonGenerator[][] propValue) | ||||||||||
void |
setProperty(String propName, boolean propValue)
This method adds a boolean property to the bone
| ||||||||||
void |
setProperty(String propName, int propValue)
This method adds an integer property to the bone
| ||||||||||
void |
setProperty(String propName, String[] propValue)
This method adds a String array property to the bone
| ||||||||||
void |
setProperty(String propName, int[] propValue)
This method adds an integers array property to the bone.
| ||||||||||
void | setProperty(String propName, GenericJsonGenerator[] propValue) | ||||||||||
int | size() | ||||||||||
String |
toString()
This method is deprecated.
Inefficient--it is preferable to serialize the contents
of this object into an existing StringBuilder instance. Use
serializeInto(StringBuilder) instead. | ||||||||||
String |
toStringStart()
This method builds part of the JSON string that represents this object
the string outcome include the starting bracket and all the properties this object holds
without the ending bracket.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void | addProperty(String propName, String propValue, boolean encodeName) | ||||||||||
void | addProperty(String propName, String propValue) | ||||||||||
String | encodeData(String data) |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
The default, no args constructor.
A constructor that passes in a Comparator to use for sorting properties.
keyComparator | The Comparator to use for ordering the keys in the map. If null, then no ordering is guaranteed. |
---|
A constructor used if caller needs the properties insertion order to be preserved
preserveOrder | whether to preserve the insertion order. |
---|
Serialize the contents of this object into the supplied StringBuilder, growing it first, as necessary, to accommodate the serialized form.
stringBuilder | The StringBuilder to serialize into. |
---|
Sets bean paths as properties of this Json
wc | the web component that will be used to resolve the bean events. |
---|---|
events | an array of event codes |
This method adds a JavaScript Object property to the bone
propName | String the name of the property |
---|---|
propValue | String the value of the property, that when parsed by the browser will evaluate into a JavaScript object |
This method adds a String property to the bone
propName | String the name of the property |
---|---|
propValue | String the value of the property |
This method adds a String property to the bone
propName | String the name of the property |
---|---|
propValue | String the value of the property |
quote | If 'true', then encode the data in the string and quote it (with a single quote). |
This method adds a double property to the bone
propName | String the name of the property |
---|---|
propValue | double the value of the property |
This method adds a float property to the bone
propName | String the name of the property |
---|---|
propValue | float the value of the property |
This method adds a JSON property to the bone
propName | String the name of the property |
---|---|
propValue | the value of the property |
This method adds a boolean property to the bone
propName | String the name of the property |
---|---|
propValue | boolean the value of the property |
This method adds an integer property to the bone
propName | String the name of the property |
---|---|
propValue | int the value of the property |
This method adds a String array property to the bone
propName | String the name of the property |
---|---|
propValue | String the value of the property |
This method adds an integers array property to the bone.
propName | String the name of the property |
---|---|
propValue | String the value of the property |
This method is deprecated.
Inefficient--it is preferable to serialize the contents
of this object into an existing StringBuilder instance. Use
serializeInto(StringBuilder)
instead.
This method builds the JSON string that represents this object
This method builds part of the JSON string that represents this object the string outcome include the starting bracket and all the properties this object holds without the ending bracket.