Class JSONUtil.JSONBuilder
java.lang.Object
de.uplanet.lucy.server.auxiliaries.JSONUtil.JSONBuilder
- Enclosing class:
- JSONUtil
A builder to create JSON output.
 
This class provides the most flexible way to create JSON output from a variety of input data.
- Since:
- Intrexx 7.0
- 
Method SummaryModifier and TypeMethodDescriptionvoidWrite an object.voidWrite a colon:.Write a colon:.voidWrite a comma,.Write a comma,.voidWrite a closing square bracket].Write a closing square bracket].voidWrite a closing curly bracket}.Write a closing curly bracket}.voidwriteJSONEscape(CharSequence p_chseq) Write a JSON-escaped character sequence.voidwriteJSONEscape(CharSequence p_chseq, int p_iStart, int p_iEnd) Write a JSON-escaped character subsequence.writeJSONEscapeR(CharSequence p_chseq) Write a JSON-escaped character sequence.writeJSONEscapeR(CharSequence p_chseq, int p_iStart, int p_iEnd) Write a JSON-escaped character subsequence.voidwriteJSONNamedObject(Object p_obj, String p_strName, Collection<? extends CharSequence> p_properties) Write a JSON named object the given object's bean properties.writeJSONNamedObjectR(Object p_obj, String p_strName, Collection<? extends CharSequence> p_properties) Write a JSON named object the given object's bean properties.voidwriteJSONObject(Object p_obj, List<CharSequence> p_properties) Write a JSON object with the given object's bean properties.writeJSONObjectR(Object p_obj, Collection<? extends CharSequence> p_properties) Write a JSON named object the given object's bean properties.voidwriteJSONPair(String p_strName, Object p_value) Write a name-value pair, e.g.writeJSONPairR(String p_strName, Object p_value) Write a name-value pair, e.g.voidwriteJSONPairs(Object p_obj, List<? extends CharSequence> p_properties) Write name-value pairs ("name":"value",...) representing the given object's bean properties.voidwriteJSONPairs(Map<String, ? extends Object> p_map) Write the name-value pairs ("name":"value",...) of the given map.writeJSONPairsR(Object p_obj, List<? extends CharSequence> p_properties) Write name-value pairs ("name":"value",...) representing the given object's bean properties.writeJSONPairsR(Map<String, ? extends Object> p_map) Write the name-value pairs ("name":"value",...) of the given map.voidWrite a double quotation mark".Write a double quotation mark".writeJSONR(Object p_obj) Write an object.voidWrite an opening square bracket[.Write an opening square bracket[.voidWrite an opening curly bracket{.Write an opening curly bracket{.
- 
Method Details- 
writeJSONStartObjectWrite an opening curly bracket{.- Throws:
- IOException- If an I/O error occurred.
 
- 
writeJSONStartObjectRWrite an opening curly bracket{.- Returns:
- This object.
- Throws:
- IOException- If an I/O error occurred.
 
- 
writeJSONEndObjectWrite a closing curly bracket}.- Throws:
- IOException- If an I/O error occurred.
 
- 
writeJSONEndObjectRWrite a closing curly bracket}.- Returns:
- This object.
- Throws:
- IOException- If an I/O error occurred.
 
- 
writeJSONStartArrayWrite an opening square bracket[.- Throws:
- IOException- If an I/O error occurred.
 
- 
writeJSONStartArrayRWrite an opening square bracket[.- Returns:
- This object.
- Throws:
- IOException- If an I/O error occurred.
 
- 
writeJSONEndArrayWrite a closing square bracket].- Throws:
- IOException- If an I/O error occurred.
 
- 
writeJSONEndArrayRWrite a closing square bracket].- Returns:
- This object.
- Throws:
- IOException- If an I/O error occurred.
 
- 
writeJSONQuoteWrite a double quotation mark".- Throws:
- IOException- If an I/O error occurred.
 
- 
writeJSONQuoteRWrite a double quotation mark".- Returns:
- This object.
- Throws:
- IOException- If an I/O error occurred.
 
- 
writeJSONCommaWrite a comma,.- Throws:
- IOException- If an I/O error occurred.
 
- 
writeJSONCommaRWrite a comma,.- Returns:
- This object.
- Throws:
- IOException- If an I/O error occurred.
 
- 
writeJSONColonWrite a colon:.- Throws:
- IOException- If an I/O error occurred.
 
- 
writeJSONColonRWrite a colon:.- Returns:
- This object.
- Throws:
- IOException- If an I/O error occurred.
 
- 
writeJSONWrite an object. The method mimics theJSON.stringifyfunction as defined in the ECMAScript Language Scecification, 5.1 edition.- Parameters:
- p_obj- The object to be written.
- Throws:
- IOException- If an I/O error occurred.
 
- 
writeJSONRWrite an object. The method mimics theJSON.stringifyfunction as defined in the ECMAScript Language Scecification, 5.1 edition.- Parameters:
- p_obj- The object to be written.
- Returns:
- This object.
- Throws:
- IOException- If an I/O error occurred.
 
- 
writeJSONPairWrite a name-value pair, e.g."name":"value".- Throws:
- IOException- If an I/O error occurred.
 
- 
writeJSONPairRWrite a name-value pair, e.g."name":"value".- Returns:
- This object.
- Throws:
- IOException- If an I/O error occurred.
 
- 
writeJSONPairsWrite the name-value pairs ("name":"value",...) of the given map.- Parameters:
- p_map- A map containing the pairs.
- Throws:
- IOException- If an I/O error occurred.
 
- 
writeJSONPairsRWrite the name-value pairs ("name":"value",...) of the given map.- Parameters:
- p_map- A map containing the pairs.
- Returns:
- This object.
- Throws:
- IOException- If an I/O error occurred.
 
- 
writeJSONPairspublic void writeJSONPairs(Object p_obj, List<? extends CharSequence> p_properties) throws IOException Write name-value pairs ("name":"value",...) representing the given object's bean properties.- Parameters:
- p_obj- The object.
- p_properties- A list of bean properties that should be written as name-value pairs.
- Throws:
- IOException- If an I/O error occurred.
 
- 
writeJSONPairsRpublic JSONUtil.JSONBuilder writeJSONPairsR(Object p_obj, List<? extends CharSequence> p_properties) throws IOException Write name-value pairs ("name":"value",...) representing the given object's bean properties.- Parameters:
- p_obj- The object.
- p_properties- A list of bean properties that should be written as name-value pairs.
- Returns:
- This object.
- Throws:
- IOException- If an I/O error occurred.
 
- 
writeJSONObjectWrite a JSON object with the given object's bean properties.- Parameters:
- p_obj- The object.
- p_properties- A list of bean properties that should be written as name-value pairs.
- Throws:
- IOException- If an I/O error occurred.
 
- 
writeJSONObjectRpublic JSONUtil.JSONBuilder writeJSONObjectR(Object p_obj, Collection<? extends CharSequence> p_properties) throws IOException Write a JSON named object the given object's bean properties.- Parameters:
- p_obj- The object.
- p_properties- A list of bean properties that should be written as name-value pairs.
- Returns:
- This object.
- Throws:
- IOException- If an I/O error occurred.
 
- 
writeJSONNamedObjectpublic void writeJSONNamedObject(Object p_obj, String p_strName, Collection<? extends CharSequence> p_properties) throws IOException Write a JSON named object the given object's bean properties.- Parameters:
- p_obj- The object.
- p_strName- The name of the object.
- p_properties- A list of bean properties that should be written as name-value pairs.
- Throws:
- IOException- If an I/O error occurred.
 
- 
writeJSONNamedObjectRpublic JSONUtil.JSONBuilder writeJSONNamedObjectR(Object p_obj, String p_strName, Collection<? extends CharSequence> p_properties) throws IOException Write a JSON named object the given object's bean properties.- Parameters:
- p_obj- The object.
- p_strName- The name of the object.
- p_properties- A list of bean properties that should be written as name-value pairs.
- Returns:
- This object.
- Throws:
- IOException- If an I/O error occurred.
 
- 
writeJSONEscapeWrite a JSON-escaped character sequence.- Parameters:
- p_chseq- The character sequence to be written.
- Throws:
- IOException- If an I/O error occurred.
 
- 
writeJSONEscapeRWrite a JSON-escaped character sequence.- Parameters:
- p_chseq- The character sequence to be written.
- Returns:
- This object.
- Throws:
- IOException- If an I/O error occurred.
 
- 
writeJSONEscapeWrite a JSON-escaped character subsequence.- Parameters:
- p_chseq- The character sequence to be written.
- p_iStart- The index of the first character in the subsequence.
- p_iEnd- The index of the character following the last character in the subsequence.
- Throws:
- IOException- If an I/O error occurred.
- IllegalArgumentException- If the given character sequence is- null.
 
- 
writeJSONEscapeRpublic JSONUtil.JSONBuilder writeJSONEscapeR(CharSequence p_chseq, int p_iStart, int p_iEnd) throws IOException Write a JSON-escaped character subsequence.- Parameters:
- p_chseq- The character sequence to be written.
- p_iStart- The index of the first character in the subsequence.
- p_iEnd- The index of the character following the last character in the subsequence.
- Returns:
- This object.
- Throws:
- IOException- If an I/O error occurred.
- IllegalArgumentException- If the given character sequence is- null.
 
 
-