Package Torello.JSON
Class RorPBoxedJSON
- java.lang.Object
-
- Torello.JSON.RorPBoxedJSON
-
public class RorPBoxedJSON extends java.lang.Object
Utilities for parsing & convertingJsonString's orJsonNumber's into Java Boxed-Primitive Types.
This class builds on the J2EE Standard 'Glass-Fish' JSON Processor
There are several JSON Parsers available, and even more implementations for serializing and de-serializing data to/from JSON. The Glass Fish Tool is included in the J2EE, and is available on GitHub. That is the one used by the Java HTML JAR Library (See:javax.json.*)
Primary Classes Used:JsonArrayandJsonObject
This comment-note is intentionally repeated, verbatim, at the top of all Json Reader Classes in this package.
JSON to Java Binding:
JSON-Binding is the art of converting data that has been stored, saved or transmitted usingJava-Script Object Notationinto a Java Primitive or Object-Type.JSONcan arrive into Java-Program Memory from almost any source. If you are wondering why such a massive amount of "work" is necessary just to convert a Json Integer into Java Integer, the value added is the extraordinary amount of attention paid to user configuration, error checking, & exception messaging. Methods here don't require more than 1 or 2 lines of code, and guarantee that a thorough type checking is performed.
Unlike Java-Types which are checked by the Java-Compiler each-and-every time a programmer compiles his project, any guarantee that JSON-Type Data is pristine, uncorrupted, and in any kind of pre-agreed format may or may not be assured. The methods here are able to handle changes that might be made to an API (possibly from great distances away, and without the Software-Manager's consent). If an error could occur, configuration flags can be used to determine default error-recovery behaviors. If an exception does throw, the exception messages printed will contain multiple lines of detailed information.- Utilizes the Java-Standard
javax.json.*Package-Library, & its Glass-Fish Implementation - Handles the Transfer & Conversion of All Json-Type's into Java-Type's with just One Line of Code
- Provides all manner of User-Configurable Exception-Handling &
Error-Decision Management via Class
JFlag - Provides a Fine-Grained Suite of Exception-Classes, all with Consistent & Meaningful Error-Messages. Json Files can occasionally grow extremely large, and error messaging details make debugging easier
- Primary Helper-Classes for the (Experimental) Google-Chrome
Browser AutomationPackage
The goal ofTorello.JSONis to provide small, static helper methods in the same spirit asjava.util.Objectsandjava.util.Arrays: simple calls that keep JSON handling out of your application logic. Instead of repeating loops, type checks, null checks, and exception wiring at every call site, these methods centralize that work behind a consistent set of straight-forward “read value” operations.
Reads a single JSON value (either a number or a string) from a JsonArray or JsonObject and converts it into a corresponding Java boxed primitive type.
This class exists to make reading numeric and boolean values from large, complex JSON structures both safer and easier. While JSON itself is loosely typed, Java is not, and bridging that gap reliably requires careful handling of value types, missing fields, and unexpected representations.
In practice, JSON sources may freely alternate between numeric values and their string representations (for example3versus"3"), may omit optional fields entirely, or may returnnullin cases where a value is not mandatory. This class provides explicit, well-organized methods for handling each of these cases, ensuring that conversions are performed deliberately and that mistakes are detected immediately.
Rather than attempting to infer or generate higher-level Java types, this class focuses on making low-level JSON access predictable and transparent. A significant amount of effort is dedicated to validating inputs and producing detailed error messages, so that when something goes wrong while traversing an unfamiliar or evolving JSON document, the cause of the failure is clear and actionable. The result is less repeated boilerplate, fewer silent failures, and greater confidence when consuming complex JSON data.
Method Parameters
Parameter Explanation jaA JsonArraywhose element (atindex) is being converted into a Java Boxed-Primitive value.
In this class, the array-element may be either aJsonNumberor aJsonString.
When the element is aJsonString, the method will invoke the matchingParseBoxedJSONmethod to parse the string contents.
When the element is not aJsonString(including out-of-bounds), the method will invoke the matchingReadBoxedJSONmethod (expecting aJsonNumberorJsonValue.TRUE/FALSE).
If the element isJsonValue.NULL, these methods may return Javanull(depending on the specific overload and/or flags).indexThe zero-based array index of the element being read / parsed from ja.
Some method overloads useiinstead ofindex— it is the same meaning: the array element position.
With “no-flags” overloads, out-of-bounds indexes throw the normal Java exception. WithFLAGSoverloads, flags may allow returning Java-nullordefaultValueinstead.joA JsonObjectwhose property value (namedpropertyName) is being converted into a Java Boxed-Primitive value.
In this class, the property value may be either aJsonNumberor aJsonString.
When the property value is aJsonString, the method will invoke the matchingParseBoxedJSONmethod to parse the string contents.
When the property value is missing (null) or not aJsonString, the method will invoke the matchingReadBoxedJSONmethod (expecting aJsonNumberorJsonValue.TRUE/FALSE).
If the property exists but containsJsonValue.NULL, these methods may return Javanull(depending on the specific overload and/or flags).propertyNameThe name of the JsonObjectproperty to retrieve fromjo.
If the property is not present and you are using a “no-flags” overload, behavior is controlled byisOptional.
If the property is not present and you are using aFLAGSoverload, the flags may allow returning Java-nullor adefaultValue.isOptionalUsed by the “no-flags” JsonObjectmethod overloads.
Whentrueandjodoes not containpropertyName, the method returns Java-null.
Whenfalseand the property is missing, an exception is thrown.
Note: this parameter is about the property missing case. If the property exists but isJsonValue.NULL, the methods may still return Javanull(the classes intentionally allow null-returns).FLAGSA bit-mask of JFlagconstants that alters failure/edge-case behavior.
WhenFLAGSis0, the “normal” behavior applies (exceptions are thrown for missing property, wrong JSON type, parse failure, arithmetic conversion failures, out-of-bounds index, etc.).
When one or more flags are supplied, certain problems may be handled by returning Java-nullor returningdefaultValueinstead of throwing.See the “Default-Value Flags” / “Flags Master List” documentation for the authoritative per-flag meaning in classJFlagdefaultValueA Java <PRIMITIVE>fallback value that may be returned by theFLAGS-method overloads.
If the selected flags request a “default-value return” for some failure/edge-case (missing property, null, wrong type, parse/arithmetic error, out-of-bounds, etc.), this is the value that will be returned.Note that the return type of the public methods is the corresponding Boxed Type (example:java.lang.Integer). The type ofdefaultValueis the matching primitive type. Java's "Auto-Boxing" and "Auto Un-Boxing" makes this easy.optionalParserA user-supplied parsing function: Function<String, BOXED_TYPE>.
When the JSON value is aJsonString, this (optional) function may be used to convert the string content into the target Java boxed value.
IfoptionalParserisnull, the default parsing logic insideParseBoxedJSONis used.optionalParseris only relevant when the JSON value being processed is aJsonString. When the value is aJsonNumberorJsonValue.TRUE/FALSE, theReadBoxedJSONpath is taken, and this parameter is ignored.
Single Character:
Note that this class simply doesn't support any methods for reading ajava.lang.Character. This is because their are just entirely too many possibilities, combinations & options for the appropriate "Default Behavior" when attempting to read a single character of data from any random JSON Data-Type.
Remember that the JSON Specification does not posses any "Single-JSON-Character" Data-Type. Creating some kind of Flag-Controlled Reader for a'char'that can capably decide what to do would be so overtly verbose, for something so simple, that it isn't worth the effort...- See Also:
JsonObject,JsonArray
Hi-Lited Source-Code:- View Here: Torello/JSON/RorPBoxedJSON.java
- Open New Browser-Tab: Torello/JSON/RorPBoxedJSON.java
File Size: 27,255 Bytes Line Count: 665 '\n' Characters Found
Stateless Class:This class neither contains any program-state, nor can it be instantiated. The@StaticFunctionalAnnotation may also be called 'The Spaghetti Report'.Static-Functionalclasses are, essentially, C-Styled Files, without any constructors or non-static member fields. It is a concept very similar to the Java-Bean's@StatelessAnnotation.
- 1 Constructor(s), 1 declared private, zero-argument constructor
- 28 Method(s), 28 declared static
- 0 Field(s)
- Utilizes the Java-Standard
-
-
Method Summary
No Control Flags: Retrieve either a JsonNumberorJsonStringfrom aJsonArrayand Transform it to a Boxed-NumericModifier and Type Method static BytegetByte(JsonArray ja, int i)static DoublegetDouble(JsonArray ja, int i)static FloatgetFloat(JsonArray ja, int i)static IntegergetInteger(JsonArray ja, int i)static LonggetLong(JsonArray ja, int i)static ShortgetShort(JsonArray ja, int i)No Control Flags: Retrieve either a JsonNumberorJsonStringfrom aJsonObjectand Transform it to a Boxed-NumericModifier and Type Method static BytegetByte(JsonObject jo, String propertyName, boolean isOptional)static DoublegetDouble(JsonObject jo, String propertyName, boolean isOptional)static FloatgetFloat(JsonObject jo, String propertyName, boolean isOptional)static IntegergetInteger(JsonObject jo, String propertyName, boolean isOptional)static LonggetLong(JsonObject jo, String propertyName, boolean isOptional)static ShortgetShort(JsonObject jo, String propertyName, boolean isOptional)Using Error Control Flags: Retrieve either a JsonNumberorJsonStringfrom aJsonArrayand Transform it to a Boxed-NumericModifier and Type Method static BytegetByte(JsonArray ja, int i, int FLAGS, byte defaultValue, Function<String,Byte> optionalParser)static DoublegetDouble(JsonArray ja, int i, int FLAGS, double defaultValue, Function<String,Double> optionalParser)static FloatgetFloat(JsonArray ja, int i, int FLAGS, float defaultValue, Function<String,Float> optionalParser)static IntegergetInteger(JsonArray ja, int i, int FLAGS, int defaultValue, Function<String,Integer> optionalParser)static LonggetLong(JsonArray ja, int i, int FLAGS, long defaultValue, Function<String,Long> optionalParser)static ShortgetShort(JsonArray ja, int i, int FLAGS, short defaultValue, Function<String,Short> optionalParser)Using Error Control Flags: Retrieve either a JsonNumberorJsonStringfrom aJsonObjectand Transform it to a Boxed-NumericModifier and Type Method static BytegetByte(JsonObject jo, String propertyName, int FLAGS, byte defaultValue, Function<String,Byte> optionalParser)static DoublegetDouble(JsonObject jo, String propertyName, int FLAGS, double defaultValue, Function<String,Double> optionalParser)static FloatgetFloat(JsonObject jo, String propertyName, int FLAGS, float defaultValue, Function<String,Float> optionalParser)static IntegergetInteger(JsonObject jo, String propertyName, int FLAGS, int defaultValue, Function<String,Integer> optionalParser)static LonggetLong(JsonObject jo, String propertyName, int FLAGS, long defaultValue, Function<String,Long> optionalParser)static ShortgetShort(JsonObject jo, String propertyName, int FLAGS, short defaultValue, Function<String,Short> optionalParser)Boolean: Retrieve either JsonValue.TRUE,FALSEor aJsonString, and transform to Boxed-BooleanModifier and Type Method static BooleangetBoolean(JsonArray ja, int i)static BooleangetBoolean(JsonArray ja, int i, int FLAGS, boolean defaultValue, Function<String,Boolean> optionalParser)static BooleangetBoolean(JsonObject jo, String propertyName, boolean isOptional)static BooleangetBoolean(JsonObject jo, String propertyName, int FLAGS, boolean defaultValue, Function<String,Boolean> optionalParser)
-
-
-
Method Detail
-
getInteger
public static java.lang.Integer getInteger (JsonArray ja, int i, int FLAGS, int defaultValue, java.util.function.Function<java.lang.String,java.lang.Integer> optionalParser)
Read either a JsonNumber or a JsonString from a JsonArray, and translate to a Boxed IntegerChecks: Json Type of the specified JsonArrayindex contents, and dispatches based on type.Flags: Accepts all Error-Handler Flags; Suppresses exceptions when requested by the flag maskReturns: A Java Boxed Integer - See Also:
ReadBoxedJSON.getInteger(JsonArray, int, int, int),ParseBoxedJSON.parseInteger(JsonArray, int, int, int, Function)- Code:
- Exact Method Body:
return ((i >= ja.size()) || (ja.get(i).getValueType() != STRING)) ? ReadBoxedJSON.getInteger(ja, i, FLAGS, defaultValue) : ParseBoxedJSON.parseInteger(ja, i, FLAGS, defaultValue, optionalParser);
-
getLong
public static java.lang.Long getLong (JsonArray ja, int i, int FLAGS, long defaultValue, java.util.function.Function<java.lang.String,java.lang.Long> optionalParser)
Read either a JsonNumber or a JsonString from a JsonArray, and translate to a Boxed Long IntegerChecks: Json Type of the specified JsonArrayindex contents, and dispatches based on type.Flags: Accepts all Error-Handler Flags; Suppresses exceptions when requested by the flag maskReturns: A Java Boxed Long - See Also:
ReadBoxedJSON.getLong(JsonArray, int, int, long),ParseBoxedJSON.parseLong(JsonArray, int, int, long, Function)- Code:
- Exact Method Body:
return ((i >= ja.size()) || (ja.get(i).getValueType() != STRING)) ? ReadBoxedJSON.getLong(ja, i, FLAGS, defaultValue) : ParseBoxedJSON.parseLong(ja, i, FLAGS, defaultValue, optionalParser);
-
getShort
public static java.lang.Short getShort (JsonArray ja, int i, int FLAGS, short defaultValue, java.util.function.Function<java.lang.String,java.lang.Short> optionalParser)
Read either a JsonNumber or a JsonString from a JsonArray, and translate to a Boxed Short IntegerChecks: Json Type of the specified JsonArrayindex contents, and dispatches based on type.Flags: Accepts all Error-Handler Flags; Suppresses exceptions when requested by the flag maskReturns: A Java Boxed Short - See Also:
ReadBoxedJSON.getShort(JsonArray, int, int, short),ParseBoxedJSON.parseShort(JsonArray, int, int, short, Function)- Code:
- Exact Method Body:
return ((i >= ja.size()) || (ja.get(i).getValueType() != STRING)) ? ReadBoxedJSON.getShort(ja, i, FLAGS, defaultValue) : ParseBoxedJSON.parseShort(ja, i, FLAGS, defaultValue, optionalParser);
-
getByte
public static java.lang.Byte getByte (JsonArray ja, int i, int FLAGS, byte defaultValue, java.util.function.Function<java.lang.String,java.lang.Byte> optionalParser)
Read either a JsonNumber or a JsonString from a JsonArray, and translate to a Boxed ByteChecks: Json Type of the specified JsonArrayindex contents, and dispatches based on type.Flags: Accepts all Error-Handler Flags; Suppresses exceptions when requested by the flag maskReturns: A Java Boxed Byte - See Also:
ReadBoxedJSON.getByte(JsonArray, int, int, byte),ParseBoxedJSON.parseByte(JsonArray, int, int, byte, Function)- Code:
- Exact Method Body:
return ((i >= ja.size()) || (ja.get(i).getValueType() != STRING)) ? ReadBoxedJSON.getByte(ja, i, FLAGS, defaultValue) : ParseBoxedJSON.parseByte(ja, i, FLAGS, defaultValue, optionalParser);
-
getDouble
public static java.lang.Double getDouble (JsonArray ja, int i, int FLAGS, double defaultValue, java.util.function.Function<java.lang.String,java.lang.Double> optionalParser)
Read either a JsonNumber or a JsonString from a JsonArray, and translate to a Boxed DoubleChecks: Json Type of the specified JsonArrayindex contents, and dispatches based on type.Flags: Accepts all Error-Handler Flags; Suppresses exceptions when requested by the flag maskReturns: A Java Boxed Double - See Also:
ReadBoxedJSON.getDouble(JsonArray, int, int, double),ParseBoxedJSON.parseDouble(JsonArray, int, int, double, Function)- Code:
- Exact Method Body:
return ((i >= ja.size()) || (ja.get(i).getValueType() != STRING)) ? ReadBoxedJSON.getDouble(ja, i, FLAGS, defaultValue) : ParseBoxedJSON.parseDouble(ja, i, FLAGS, defaultValue, optionalParser);
-
getFloat
public static java.lang.Float getFloat (JsonArray ja, int i, int FLAGS, float defaultValue, java.util.function.Function<java.lang.String,java.lang.Float> optionalParser)
Read either a JsonNumber or a JsonString from a JsonArray, and translate to a Boxed FloatChecks: Json Type of the specified JsonArrayindex contents, and dispatches based on type.Flags: Accepts all Error-Handler Flags; Suppresses exceptions when requested by the flag maskReturns: A Java Boxed Float - See Also:
ReadBoxedJSON.getFloat(JsonArray, int, int, float),ParseBoxedJSON.parseFloat(JsonArray, int, int, float, Function)- Code:
- Exact Method Body:
return ((i >= ja.size()) || (ja.get(i).getValueType() != STRING)) ? ReadBoxedJSON.getFloat(ja, i, FLAGS, defaultValue) : ParseBoxedJSON.parseFloat(ja, i, FLAGS, defaultValue, optionalParser);
-
getBoolean
public static java.lang.Boolean getBoolean (JsonArray ja, int i, int FLAGS, boolean defaultValue, java.util.function.Function<java.lang.String,java.lang.Boolean> optionalParser)
Read either a JsonNumber or a JsonString from a JsonArray, and translate to a Boxed BooleanChecks: Json Type of the specified JsonArrayindex contents, and dispatches based on type.Flags: Accepts all Error-Handler Flags; Suppresses exceptions when requested by the flag maskReturns: A Java Boxed Boolean - See Also:
ReadBoxedJSON.getBoolean(JsonArray, int, int, boolean),ParseBoxedJSON.parseBoolean(JsonArray, int, int, boolean, Function)- Code:
- Exact Method Body:
return ((i >= ja.size()) || (ja.get(i).getValueType() != STRING)) ? ReadBoxedJSON.getBoolean(ja, i, FLAGS, defaultValue) : ParseBoxedJSON.parseBoolean(ja, i, FLAGS, defaultValue, optionalParser);
-
getInteger
public static java.lang.Integer getInteger (JsonObject jo, java.lang.String propertyName, int FLAGS, int defaultValue, java.util.function.Function<java.lang.String,java.lang.Integer> optionalParser)
Read either a JsonNumber or a JsonString from a JsonObject, and translate to a Boxed IntegerChecks: Json Type of the specified JsonObjectproperty, and dispatches based on type.Flags: Accepts all Error-Handler Flags; Suppresses exceptions when requested by the flag maskReturns: A Java Boxed Integer - See Also:
ReadBoxedJSON.getInteger(JsonObject, String, int, int),ParseBoxedJSON.parseInteger(JsonObject, String, int, int, Function)- Code:
- Exact Method Body:
final JsonValue jv = jo.get(propertyName); return ((jv == null) || (jv.getValueType() != STRING)) ? ReadBoxedJSON.getInteger(jo, propertyName, FLAGS, defaultValue) : ParseBoxedJSON.parseInteger(jo, propertyName, FLAGS, defaultValue, optionalParser);
-
getLong
public static java.lang.Long getLong (JsonObject jo, java.lang.String propertyName, int FLAGS, long defaultValue, java.util.function.Function<java.lang.String,java.lang.Long> optionalParser)
Read either a JsonNumber or a JsonString from a JsonObject, and translate to a Boxed Long IntegerChecks: Json Type of the specified JsonObjectproperty, and dispatches based on type.Flags: Accepts all Error-Handler Flags; Suppresses exceptions when requested by the flag maskReturns: A Java Boxed Long - See Also:
ReadBoxedJSON.getLong(JsonObject, String, int, long),ParseBoxedJSON.parseLong(JsonObject, String, int, long, Function)- Code:
- Exact Method Body:
final JsonValue jv = jo.get(propertyName); return ((jv == null) || (jv.getValueType() != STRING)) ? ReadBoxedJSON.getLong(jo, propertyName, FLAGS, defaultValue) : ParseBoxedJSON.parseLong(jo, propertyName, FLAGS, defaultValue, optionalParser);
-
getShort
public static java.lang.Short getShort (JsonObject jo, java.lang.String propertyName, int FLAGS, short defaultValue, java.util.function.Function<java.lang.String,java.lang.Short> optionalParser)
Read either a JsonNumber or a JsonString from a JsonObject, and translate to a Boxed Short IntegerChecks: Json Type of the specified JsonObjectproperty, and dispatches based on type.Flags: Accepts all Error-Handler Flags; Suppresses exceptions when requested by the flag maskReturns: A Java Boxed Short - See Also:
ReadBoxedJSON.getShort(JsonObject, String, int, short),ParseBoxedJSON.parseShort(JsonObject, String, int, short, Function)- Code:
- Exact Method Body:
final JsonValue jv = jo.get(propertyName); return ((jv == null) || (jv.getValueType() != STRING)) ? ReadBoxedJSON.getShort(jo, propertyName, FLAGS, defaultValue) : ParseBoxedJSON.parseShort(jo, propertyName, FLAGS, defaultValue, optionalParser);
-
getByte
public static java.lang.Byte getByte (JsonObject jo, java.lang.String propertyName, int FLAGS, byte defaultValue, java.util.function.Function<java.lang.String,java.lang.Byte> optionalParser)
Read either a JsonNumber or a JsonString from a JsonObject, and translate to a Boxed ByteChecks: Json Type of the specified JsonObjectproperty, and dispatches based on type.Flags: Accepts all Error-Handler Flags; Suppresses exceptions when requested by the flag maskReturns: A Java Boxed Byte - See Also:
ReadBoxedJSON.getByte(JsonObject, String, int, byte),ParseBoxedJSON.parseByte(JsonObject, String, int, byte, Function)- Code:
- Exact Method Body:
final JsonValue jv = jo.get(propertyName); return ((jv == null) || (jv.getValueType() != STRING)) ? ReadBoxedJSON.getByte(jo, propertyName, FLAGS, defaultValue) : ParseBoxedJSON.parseByte(jo, propertyName, FLAGS, defaultValue, optionalParser);
-
getDouble
public static java.lang.Double getDouble (JsonObject jo, java.lang.String propertyName, int FLAGS, double defaultValue, java.util.function.Function<java.lang.String,java.lang.Double> optionalParser)
Read either a JsonNumber or a JsonString from a JsonObject, and translate to a Boxed DoubleChecks: Json Type of the specified JsonObjectproperty, and dispatches based on type.Flags: Accepts all Error-Handler Flags; Suppresses exceptions when requested by the flag maskReturns: A Java Boxed Double - See Also:
ReadBoxedJSON.getDouble(JsonObject, String, int, double),ParseBoxedJSON.parseDouble(JsonObject, String, int, double, Function)- Code:
- Exact Method Body:
final JsonValue jv = jo.get(propertyName); return ((jv == null) || (jv.getValueType() != STRING)) ? ReadBoxedJSON.getDouble(jo, propertyName, FLAGS, defaultValue) : ParseBoxedJSON.parseDouble(jo, propertyName, FLAGS, defaultValue, optionalParser);
-
getFloat
public static java.lang.Float getFloat (JsonObject jo, java.lang.String propertyName, int FLAGS, float defaultValue, java.util.function.Function<java.lang.String,java.lang.Float> optionalParser)
Read either a JsonNumber or a JsonString from a JsonObject, and translate to a Boxed FloatChecks: Json Type of the specified JsonObjectproperty, and dispatches based on type.Flags: Accepts all Error-Handler Flags; Suppresses exceptions when requested by the flag maskReturns: A Java Boxed Float - See Also:
ReadBoxedJSON.getFloat(JsonObject, String, int, float),ParseBoxedJSON.parseFloat(JsonObject, String, int, float, Function)- Code:
- Exact Method Body:
final JsonValue jv = jo.get(propertyName); return ((jv == null) || (jv.getValueType() != STRING)) ? ReadBoxedJSON.getFloat(jo, propertyName, FLAGS, defaultValue) : ParseBoxedJSON.parseFloat(jo, propertyName, FLAGS, defaultValue, optionalParser);
-
getBoolean
public static java.lang.Boolean getBoolean (JsonObject jo, java.lang.String propertyName, int FLAGS, boolean defaultValue, java.util.function.Function<java.lang.String,java.lang.Boolean> optionalParser)
Read either a JsonNumber or a JsonString from a JsonObject, and translate to a Boxed BooleanChecks: Json Type of the specified JsonObjectproperty, and dispatches based on type.Flags: Accepts all Error-Handler Flags; Suppresses exceptions when requested by the flag maskReturns: A Java Boxed Boolean - See Also:
ReadBoxedJSON.getBoolean(JsonObject, String, int, boolean),ParseBoxedJSON.parseBoolean(JsonObject, String, int, boolean, Function)- Code:
- Exact Method Body:
final JsonValue jv = jo.get(propertyName); return ((jv == null) || (jv.getValueType() != STRING)) ? ReadBoxedJSON.getBoolean(jo, propertyName, FLAGS, defaultValue) : ParseBoxedJSON.parseBoolean(jo, propertyName, FLAGS, defaultValue, optionalParser);
-
getInteger
public static java.lang.Integer getInteger(JsonArray ja, int i)
Read either a JsonNumber or a JsonString from a JsonArray, and translate to a Boxed IntegerChecks: Json Type of the specified array index contents, and dispatches based on type. Flags: Does not accept user configuration flags. Instead, throws all default exceptions on error. Returns: A Java Boxed Integer - See Also:
ReadBoxedJSON.getInteger(JsonArray, int),ParseBoxedJSON.parseInteger(JsonArray, int)- Code:
- Exact Method Body:
return ((i >= ja.size()) || (ja.get(i).getValueType() != STRING)) ? ReadBoxedJSON.getInteger(ja, i) : ParseBoxedJSON.parseInteger(ja, i);
-
getLong
public static java.lang.Long getLong(JsonArray ja, int i)
Read either a JsonNumber or a JsonString from a JsonArray, and translate to a Boxed Long IntegerChecks: Json Type of the specified array index contents, and dispatches based on type. Flags: Does not accept user configuration flags. Instead, throws all default exceptions on error. Returns: A Java Boxed Long - See Also:
ReadBoxedJSON.getLong(JsonArray, int),ParseBoxedJSON.parseLong(JsonArray, int)- Code:
- Exact Method Body:
return ((i >= ja.size()) || (ja.get(i).getValueType() != STRING)) ? ReadBoxedJSON.getLong(ja, i) : ParseBoxedJSON.parseLong(ja, i);
-
getShort
public static java.lang.Short getShort(JsonArray ja, int i)
Read either a JsonNumber or a JsonString from a JsonArray, and translate to a Boxed Short IntegerChecks: Json Type of the specified array index contents, and dispatches based on type. Flags: Does not accept user configuration flags. Instead, throws all default exceptions on error. Returns: A Java Boxed Short - See Also:
ReadBoxedJSON.getShort(JsonArray, int),ParseBoxedJSON.parseShort(JsonArray, int)- Code:
- Exact Method Body:
return ((i >= ja.size()) || (ja.get(i).getValueType() != STRING)) ? ReadBoxedJSON.getShort(ja, i) : ParseBoxedJSON.parseShort(ja, i);
-
getByte
public static java.lang.Byte getByte(JsonArray ja, int i)
Read either a JsonNumber or a JsonString from a JsonArray, and translate to a Boxed ByteChecks: Json Type of the specified array index contents, and dispatches based on type. Flags: Does not accept user configuration flags. Instead, throws all default exceptions on error. Returns: A Java Boxed Byte - See Also:
ReadBoxedJSON.getByte(JsonArray, int),ParseBoxedJSON.parseByte(JsonArray, int)- Code:
- Exact Method Body:
return ((i >= ja.size()) || (ja.get(i).getValueType() != STRING)) ? ReadBoxedJSON.getByte(ja, i) : ParseBoxedJSON.parseByte(ja, i);
-
getDouble
public static java.lang.Double getDouble(JsonArray ja, int i)
Read either a JsonNumber or a JsonString from a JsonArray, and translate to a Boxed DoubleChecks: Json Type of the specified array index contents, and dispatches based on type. Flags: Does not accept user configuration flags. Instead, throws all default exceptions on error. Returns: A Java Boxed Double - See Also:
ReadBoxedJSON.getDouble(JsonArray, int),ParseBoxedJSON.parseDouble(JsonArray, int)- Code:
- Exact Method Body:
return ((i >= ja.size()) || (ja.get(i).getValueType() != STRING)) ? ReadBoxedJSON.getDouble(ja, i) : ParseBoxedJSON.parseDouble(ja, i);
-
getFloat
public static java.lang.Float getFloat(JsonArray ja, int i)
Read either a JsonNumber or a JsonString from a JsonArray, and translate to a Boxed FloatChecks: Json Type of the specified array index contents, and dispatches based on type. Flags: Does not accept user configuration flags. Instead, throws all default exceptions on error. Returns: A Java Boxed Float - See Also:
ReadBoxedJSON.getFloat(JsonArray, int),ParseBoxedJSON.parseFloat(JsonArray, int)- Code:
- Exact Method Body:
return ((i >= ja.size()) || (ja.get(i).getValueType() != STRING)) ? ReadBoxedJSON.getFloat(ja, i) : ParseBoxedJSON.parseFloat(ja, i);
-
getBoolean
public static java.lang.Boolean getBoolean(JsonArray ja, int i)
Read either a JsonNumber or a JsonString from a JsonArray, and translate to a Boxed BooleanChecks: Json Type of the specified array index contents, and dispatches based on type. Flags: Does not accept user configuration flags. Instead, throws all default exceptions on error. Returns: A Java Boxed Boolean - See Also:
ReadBoxedJSON.getBoolean(JsonArray, int),ParseBoxedJSON.parseBoolean(JsonArray, int)- Code:
- Exact Method Body:
return ((i >= ja.size()) || (ja.get(i).getValueType() != STRING)) ? ReadBoxedJSON.getBoolean(ja, i) : ParseBoxedJSON.parseBoolean(ja, i);
-
getInteger
public static java.lang.Integer getInteger(JsonObject jo, java.lang.String propertyName, boolean isOptional)
Read either a JsonNumber or a JsonString from a JsonObject, and translate to a Boxed IntegerChecks: Json Type of the specified JsonObjectproperty, and dispatches based on type.Flags: Does not accept user configuration flags. Instead, throws all default exceptions on error. Returns: A Java Boxed Integer - See Also:
ReadBoxedJSON.getInteger(JsonObject, String, boolean),ParseBoxedJSON.parseInteger(JsonObject, String, boolean)- Code:
- Exact Method Body:
final JsonValue jv = jo.get(propertyName); return ((jv == null) || (jv.getValueType() != STRING)) ? ReadBoxedJSON.getInteger(jo, propertyName, isOptional) : ParseBoxedJSON.parseInteger(jo, propertyName, isOptional);
-
getLong
public static java.lang.Long getLong(JsonObject jo, java.lang.String propertyName, boolean isOptional)
Read either a JsonNumber or a JsonString from a JsonObject, and translate to a Boxed Long IntegerChecks: Json Type of the specified JsonObjectproperty, and dispatches based on type.Flags: Does not accept user configuration flags. Instead, throws all default exceptions on error. Returns: A Java Boxed Long - See Also:
ReadBoxedJSON.getLong(JsonObject, String, boolean),ParseBoxedJSON.parseLong(JsonObject, String, boolean)- Code:
- Exact Method Body:
final JsonValue jv = jo.get(propertyName); return ((jv == null) || (jv.getValueType() != STRING)) ? ReadBoxedJSON.getLong(jo, propertyName, isOptional) : ParseBoxedJSON.parseLong(jo, propertyName, isOptional);
-
getShort
public static java.lang.Short getShort(JsonObject jo, java.lang.String propertyName, boolean isOptional)
Read either a JsonNumber or a JsonString from a JsonObject, and translate to a Boxed Short IntegerChecks: Json Type of the specified JsonObjectproperty, and dispatches based on type.Flags: Does not accept user configuration flags. Instead, throws all default exceptions on error. Returns: A Java Boxed Short - See Also:
ReadBoxedJSON.getShort(JsonObject, String, boolean),ParseBoxedJSON.parseShort(JsonObject, String, boolean)- Code:
- Exact Method Body:
final JsonValue jv = jo.get(propertyName); return ((jv == null) || (jv.getValueType() != STRING)) ? ReadBoxedJSON.getShort(jo, propertyName, isOptional) : ParseBoxedJSON.parseShort(jo, propertyName, isOptional);
-
getByte
public static java.lang.Byte getByte(JsonObject jo, java.lang.String propertyName, boolean isOptional)
Read either a JsonNumber or a JsonString from a JsonObject, and translate to a Boxed ByteChecks: Json Type of the specified JsonObjectproperty, and dispatches based on type.Flags: Does not accept user configuration flags. Instead, throws all default exceptions on error. Returns: A Java Boxed Byte - See Also:
ReadBoxedJSON.getByte(JsonObject, String, boolean),ParseBoxedJSON.parseByte(JsonObject, String, boolean)- Code:
- Exact Method Body:
final JsonValue jv = jo.get(propertyName); return ((jv == null) || (jv.getValueType() != STRING)) ? ReadBoxedJSON.getByte(jo, propertyName, isOptional) : ParseBoxedJSON.parseByte(jo, propertyName, isOptional);
-
getDouble
public static java.lang.Double getDouble(JsonObject jo, java.lang.String propertyName, boolean isOptional)
Read either a JsonNumber or a JsonString from a JsonObject, and translate to a Boxed DoubleChecks: Json Type of the specified JsonObjectproperty, and dispatches based on type.Flags: Does not accept user configuration flags. Instead, throws all default exceptions on error. Returns: A Java Boxed Double - See Also:
ReadBoxedJSON.getDouble(JsonObject, String, boolean),ParseBoxedJSON.parseDouble(JsonObject, String, boolean)- Code:
- Exact Method Body:
final JsonValue jv = jo.get(propertyName); return ((jv == null) || (jv.getValueType() != STRING)) ? ReadBoxedJSON.getDouble(jo, propertyName, isOptional) : ParseBoxedJSON.parseDouble(jo, propertyName, isOptional);
-
getFloat
public static java.lang.Float getFloat(JsonObject jo, java.lang.String propertyName, boolean isOptional)
Read either a JsonNumber or a JsonString from a JsonObject, and translate to a Boxed FloatChecks: Json Type of the specified JsonObjectproperty, and dispatches based on type.Flags: Does not accept user configuration flags. Instead, throws all default exceptions on error. Returns: A Java Boxed Float - See Also:
ReadBoxedJSON.getFloat(JsonObject, String, boolean),ParseBoxedJSON.parseFloat(JsonObject, String, boolean)- Code:
- Exact Method Body:
final JsonValue jv = jo.get(propertyName); return ((jv == null) || (jv.getValueType() != STRING)) ? ReadBoxedJSON.getFloat(jo, propertyName, isOptional) : ParseBoxedJSON.parseFloat(jo, propertyName, isOptional);
-
getBoolean
public static java.lang.Boolean getBoolean(JsonObject jo, java.lang.String propertyName, boolean isOptional)
Read either a JsonNumber or a JsonString from a JsonObject, and translate to a Boxed BooleanChecks: Json Type of the specified JsonObjectproperty, and dispatches based on type.Flags: Does not accept user configuration flags. Instead, throws all default exceptions on error. Returns: A Java Boxed Boolean - See Also:
ReadBoxedJSON.getBoolean(JsonObject, String, boolean),ParseBoxedJSON.parseBoolean(JsonObject, String, boolean)- Code:
- Exact Method Body:
final JsonValue jv = jo.get(propertyName); return ((jv == null) || (jv.getValueType() != STRING)) ? ReadBoxedJSON.getBoolean(jo, propertyName, isOptional) : ParseBoxedJSON.parseBoolean(jo, propertyName, isOptional);
-
-