Klasse JSONUtil
java.lang.Object
de.uplanet.lucy.server.auxiliaries.JSONUtil
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic final classA builder to create JSON output. -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungcreateBuilder(Writer p_writer, boolean p_bAutoEnableWrite) Create a JSON builder.de.uplanet.lucy.server.auxiliaries.net.HttpRequestCreate a JSON HTTP request object.Escape quotes, \, /, \r, \n, \b, \f, \t and other control characters (U+0000 through U+001F).org.json.simple.JSONArraynewArray()Create a new JSON array.org.json.simple.JSONObjectCreate a new JSON object.org.json.simple.JSONObjectCreate a new JSON object.Parse a JSON object from a character stream.parse(CharSequence p_chseq) Parse a JSON object from a character sequence.parseFromFile(String p_strPath) Parse a JSON object from a file.toJSONString(Object p_value) Convert an object to a JSON string.voidConvert an object to a JSON string and write it to a character stream.voidwriteJSONString(Object p_value, Writer p_writer) Veraltet.
-
Konstruktordetails
-
JSONUtil
public JSONUtil()
-
-
Methodendetails
-
newObject
public org.json.simple.JSONObject newObject()Create a new JSON object.- Gibt zurück:
- The new object.
-
newObject
Create a new JSON object.- Parameter:
p_map- A map that represents the JSON object.- Gibt zurück:
- The new object.
-
newArray
public org.json.simple.JSONArray newArray()Create a new JSON array.- Gibt zurück:
- The new array.
-
escape
Escape quotes, \, /, \r, \n, \b, \f, \t and other control characters (U+0000 through U+001F).- Parameter:
p_strValue- The string to be escaped.- Gibt zurück:
- The string with escaped characters.
-
toJSONString
Convert an object to a JSON string.- Parameter:
p_value- The object.- Gibt zurück:
- The object in JSON serialized form.
-
writeJSONString
Veraltet.UsewriteJSON(Writer, Object)instead.- Löst aus:
IOException
-
writeJSON
Convert an object to a JSON string and write it to a character stream.- Parameter:
p_writer- The output stream.p_value- The object.- Löst aus:
IOException
-
createBuilder
Create a JSON builder.This is the most flexible way to create JSON output from a variety of input data.
If the parameter
p_bAutoEnableWriteistruethe builder will automatically enable and disable writing on the underlying stream if the stream had previously put in the ignore-write mode.- Parameter:
p_writer- The output stream.p_bAutoEnableWrite-trueif the builder should manage writing on the underlying stream, orfalseotherwise.- Gibt zurück:
- A JSON builder that writes to the given output stream.
- Seit:
- Intrexx 7.0
-
parse
Parse a JSON object from a character stream.- Parameter:
p_reader- The input stream.- Gibt zurück:
- An instance of the following:
org.json.simple.JSONObject,org.json.simple.JSONArray,java.lang.String,java.lang.Number,java.lang.Boolean, ornull.
-
parse
Parse a JSON object from a character sequence.- Parameter:
p_chseq- The text input.- Gibt zurück:
- An instance of the following:
org.json.simple.JSONObject,org.json.simple.JSONArray,java.lang.String,java.lang.Number,java.lang.Boolean, ornull.
-
parseFromFile
public Object parseFromFile(String p_strPath) throws IOException, org.json.simple.parser.ParseException Parse a JSON object from a file.- Parameter:
p_strPath- The path to the file to be parsed.- Gibt zurück:
- An instance of the following:
org.json.simple.JSONObject,org.json.simple.JSONArray,java.lang.String,java.lang.Number,java.lang.Boolean, ornull.
- Löst aus:
org.json.simple.parser.ParseException- If the given input could not be parsed as JSON.IOException- If an I/O error occurred.
-
createJSONHttpRequest
public de.uplanet.lucy.server.auxiliaries.net.HttpRequest createJSONHttpRequest()Create a JSON HTTP request object.- Gibt zurück:
- A JSON HTTP request object.
-
writeJSON(Writer, Object)instead.