Package org.drip.service.jsonparser
Class Converter
java.lang.Object
org.drip.service.jsonparser.Converter
public class Converter
extends java.lang.Object
TypeConverter transforms the JSON Object to certain Primitive/Simple Data Type Arrays, i.e.,
double, integer, String, or JulianDate Arrays.
- Module = Computational Core Module
- Library = Computation Support
- Project = Environment, Product/Definition Containers, and Scenario/State Manipulation APIs
- Package = RFC4627 Compliant JSON Message Parser
- Author:
- Lakshmi Krishnamurthy
-
Constructor Summary
Constructors Constructor Description Converter()
-
Method Summary
Modifier and Type Method Description static JSONArray
Array(boolean[] ab)
Construct a JSON Array out of the Boolean Arraystatic JSONArray
Array(double[] adbl)
Construct a JSON Array out of the Double Arraystatic JSONArray
Array(double[][] aadbl)
Construct a JSON 2D Array out of the 2D Double Arraystatic JSONArray
Array(int[] ai)
Construct a JSON Array out of the Integer Arraystatic JSONArray
Array(java.lang.String[] astr)
Construct a JSON Array out of the String Arraystatic JSONArray
Array(JulianDate[] adt)
Construct a JSON Array out of the JulianDate Arraystatic boolean[]
BooleanArrayEntry(java.lang.Object objJSON)
Convert the JSON Entry to a Boolean Arraystatic boolean
BooleanEntry(JSONObject json, java.lang.String strEntryKey)
Convert the JSON Entry to an Booleanstatic JulianDate[]
DateArrayEntry(JSONObject json, java.lang.String strEntryKey)
Convert the JSON Entry to a Date Arraystatic JulianDate
DateEntry(JSONObject json, java.lang.String strEntryKey)
Convert the JSON Entry to a Datestatic double[]
DoubleArrayEntry(JSONObject json, java.lang.String strEntryKey)
Convert the JSON Entry to a Double Arraystatic double
DoubleEntry(JSONObject json, java.lang.String strEntryKey)
Convert the JSON Entry to a Doublestatic double[][]
DualDoubleArrayEntry(JSONObject json, java.lang.String strEntryKey)
Convert the JSON Entry to a Dual Double Arraystatic int[]
IntegerArrayEntry(java.lang.Object objJSON)
Convert the JSON Entry to an Integer Arraystatic int
IntegerEntry(JSONObject json, java.lang.String strEntryKey)
Convert the JSON Entry to an Integerstatic java.lang.String[]
StringArrayEntry(JSONObject json, java.lang.String strEntryKey)
Convert the JSON Entry to a String Arraystatic java.lang.String
StringEntry(JSONObject json, java.lang.String strEntryKey)
Convert the JSON Entry to a StringMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
Converter
public Converter()
-
-
Method Details
-
StringEntry
Convert the JSON Entry to a String- Parameters:
json
- The ObjectstrEntryKey
- The Entry Key- Returns:
- The String Form of the JSON Entry
-
StringArrayEntry
public static final java.lang.String[] StringArrayEntry(JSONObject json, java.lang.String strEntryKey)Convert the JSON Entry to a String Array- Parameters:
json
- The ObjectstrEntryKey
- The Entry Key- Returns:
- The String Array From of the JSON Entry
-
DateEntry
Convert the JSON Entry to a Date- Parameters:
json
- The ObjectstrEntryKey
- The Entry Key- Returns:
- The Date Form of the JSON Entry
-
DateArrayEntry
Convert the JSON Entry to a Date Array- Parameters:
json
- The ObjectstrEntryKey
- The Entry Key- Returns:
- The Date Array From of the JSON Entry
-
DoubleEntry
public static final double DoubleEntry(JSONObject json, java.lang.String strEntryKey) throws java.lang.ExceptionConvert the JSON Entry to a Double- Parameters:
json
- The ObjectstrEntryKey
- The Entry Key- Returns:
- The Double Form of the JSON Entry
- Throws:
java.lang.Exception
- Thrown if the Inputs are Invalid
-
DoubleArrayEntry
Convert the JSON Entry to a Double Array- Parameters:
json
- The ObjectstrEntryKey
- The Entry Key- Returns:
- The Double Array From of the JSON Entry
-
DualDoubleArrayEntry
Convert the JSON Entry to a Dual Double Array- Parameters:
json
- The ObjectstrEntryKey
- The Entry Key- Returns:
- The Dual Double Array From of the JSON Entry
-
IntegerEntry
public static final int IntegerEntry(JSONObject json, java.lang.String strEntryKey) throws java.lang.ExceptionConvert the JSON Entry to an Integer- Parameters:
json
- The ObjectstrEntryKey
- The Entry Key- Returns:
- The Integer Form of the JSON Entry
- Throws:
java.lang.Exception
- Thrown if the Inputs are Invalid
-
IntegerArrayEntry
public static final int[] IntegerArrayEntry(java.lang.Object objJSON)Convert the JSON Entry to an Integer Array- Parameters:
objJSON
- The JSON Object- Returns:
- The Integer Array From of the JSON Entry
-
BooleanEntry
public static final boolean BooleanEntry(JSONObject json, java.lang.String strEntryKey) throws java.lang.ExceptionConvert the JSON Entry to an Boolean- Parameters:
json
- The ObjectstrEntryKey
- The Entry Key- Returns:
- The Boolean Form of the JSON Entry
- Throws:
java.lang.Exception
- Thrown if the Inputs are Invalid
-
BooleanArrayEntry
public static final boolean[] BooleanArrayEntry(java.lang.Object objJSON)Convert the JSON Entry to a Boolean Array- Parameters:
objJSON
- The Object- Returns:
- The Boolean Array From of the JSON Entry
-
Array
Construct a JSON Array out of the String Array- Parameters:
astr
- The String Array- Returns:
- The JSON Array Instance
-
Array
Construct a JSON Array out of the Integer Array- Parameters:
ai
- The Integer Array- Returns:
- The JSON Array Instance
-
Array
Construct a JSON Array out of the Double Array- Parameters:
adbl
- The Double Array- Returns:
- The JSON Array Instance
-
Array
Construct a JSON 2D Array out of the 2D Double Array- Parameters:
aadbl
- The 2D Double Array- Returns:
- The JSON 2D Array Instance
-
Array
Construct a JSON Array out of the Boolean Array- Parameters:
ab
- The Boolean Array- Returns:
- The JSON Array Instance
-
Array
Construct a JSON Array out of the JulianDate Array- Parameters:
adt
- The JulianDate Array- Returns:
- The JSON Array Instance
-