|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.nimbusds.jose.util.JSONObjectUtils
public class JSONObjectUtils
JSON object helper methods for parsing and typed retrieval of member values.
Method Summary | |
---|---|
static boolean |
getBoolean(net.minidev.json.JSONObject o,
String key)
Gets a boolean member of a JSON object. |
static double |
getDouble(net.minidev.json.JSONObject o,
String key)
Gets a number member of a JSON object as double . |
static float |
getFloat(net.minidev.json.JSONObject o,
String key)
Gets a number member of a JSON object float . |
static int |
getInt(net.minidev.json.JSONObject o,
String key)
Gets an number member of a JSON object as int . |
static net.minidev.json.JSONArray |
getJSONArray(net.minidev.json.JSONObject o,
String key)
Gets a JSON array member of a JSON object. |
static net.minidev.json.JSONObject |
getJSONObject(net.minidev.json.JSONObject o,
String key)
Gets a JSON object member of a JSON object. |
static long |
getLong(net.minidev.json.JSONObject o,
String key)
Gets a number member of a JSON object as long . |
static String |
getString(net.minidev.json.JSONObject o,
String key)
Gets a string member of a JSON object. |
static String[] |
getStringArray(net.minidev.json.JSONObject o,
String key)
Gets a string array member of a JSON object. |
static URL |
getURL(net.minidev.json.JSONObject o,
String key)
Gets a string member of a JSON object as java.net.URL . |
static net.minidev.json.JSONObject |
parseJSONObject(String s)
Parses a JSON object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static net.minidev.json.JSONObject parseJSONObject(String s) throws ParseException
Specific JSON to Java entity mapping (as per JSON Smart):
java.lang.Boolean
.
java.lang.Number
.
long
.
double
.
java.lang.String
.
net.minidev.json.JSONArray
.
net.minidev.json.JSONObject
.
s
- The JSON object string to parse. Must not be null
.
ParseException
- If the string cannot be parsed to a valid JSON
object.public static boolean getBoolean(net.minidev.json.JSONObject o, String key) throws ParseException
o
- The JSON object. Must not be null
.key
- The JSON object member key. Must not be null
.
ParseException
- If the value is missing, null
or not
of the expected type.public static int getInt(net.minidev.json.JSONObject o, String key) throws ParseException
int
.
o
- The JSON object. Must not be null
.key
- The JSON object member key. Must not be null
.
ParseException
- If the value is missing, null
or not
of the expected type.public static long getLong(net.minidev.json.JSONObject o, String key) throws ParseException
long
.
o
- The JSON object. Must not be null
.key
- The JSON object member key. Must not be null
.
ParseException
- If the value is missing, null
or not
of the expected type.public static float getFloat(net.minidev.json.JSONObject o, String key) throws ParseException
float
.
o
- The JSON object. Must not be null
.key
- The JSON object member key. Must not be null
.
ParseException
- If the value is missing, null
or not
of the expected type.public static double getDouble(net.minidev.json.JSONObject o, String key) throws ParseException
double
.
o
- The JSON object. Must not be null
.key
- The JSON object member key. Must not be null
.
ParseException
- If the value is missing, null
or not
of the expected type.public static String getString(net.minidev.json.JSONObject o, String key) throws ParseException
o
- The JSON object. Must not be null
.key
- The JSON object member key. Must not be null
.
ParseException
- If the value is missing, null
or not
of the expected type.public static URL getURL(net.minidev.json.JSONObject o, String key) throws ParseException
java.net.URL
.
o
- The JSON object. Must not be null
.key
- The JSON object member key. Must not be null
.
ParseException
- If the value is missing, null
or not
of the expected type.public static net.minidev.json.JSONArray getJSONArray(net.minidev.json.JSONObject o, String key) throws ParseException
o
- The JSON object. Must not be null
.key
- The JSON object member key. Must not be null
.
ParseException
- If the value is missing, null
or not
of the expected type.public static String[] getStringArray(net.minidev.json.JSONObject o, String key) throws ParseException
o
- The JSON object. Must not be null
.key
- The JSON object member key. Must not be null
.
ParseException
- If the value is missing, null
or not
of the expected type.public static net.minidev.json.JSONObject getJSONObject(net.minidev.json.JSONObject o, String key) throws ParseException
o
- The JSON object. Must not be null
.key
- The JSON object member key. Must not be null
.
ParseException
- If the value is missing, null
or not
of the expected type.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |