Package Torello.JSON

Class ParseBoxedJSON


  • public class ParseBoxedJSON
    extends java.lang.Object
    Builds on the J2EE Standard Release JSON Parsing Tools by providing additional help with converting JSON Data 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: JsonArray and JsonObject


    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 using Java-Script Object Notation into a Java Primitive or Object-Type. JSON can 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 Automation Package

    The goal of Torello.JSON is to provide small, static helper methods in the same spirit as java.util.Objects and java.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 JsonString from a JsonArray or Object and parse it into a standard Java Boxed-Primitive

    This method provides a narrowly focused bridge between structured JSON input and Java's boxed primitive types. It assumes the JSON value being read is a JsonString, and converts that textual representation into the requested Java boxed primitive using either standard Java parsing rules or a user-supplied parser. No implicit type coercion is performed beyond what the parser itself defines.
    Two access patterns are supported: indexed lookup from a JsonArray, and key-based lookup from a JsonObject. In both cases, the method is designed to operate on a single, explicitly addressed JSON value rather than performing any form of structural traversal. This keeps the behavior predictable and allows calling code to make clear decisions about how missing, malformed, or unexpected values should be handled.

    Optional error-control flags allow callers to tune exception behavior without duplicating parsing logic across multiple call sites. This separation of concerns makes the method suitable for both strict parsing scenarios—where errors should surface immediately—and permissive scenarios, where default values or suppressed exceptions are preferred. The result is a small, reusable parsing primitive that can be safely composed into higher-level JSON processing workflows.



    Method Parameters

    Parameter Explanation
    ja A JsonArray whose element (at index) is expected to contain a JsonString value to be parsed into a Java Boxed-Primitive.

    These methods are specifically for parsing strings (example: a JSON string like "123") into a Java boxed number/boolean.

    If the element is not a JsonString, behavior is controlled by FLAGS (or an exception is thrown in “no-flags” method overloads).
    index The zero-based array index of the element being parsed from ja.

    Some method overloads use i instead of index — it is the same meaning: the array element position.

    With “no-flags” overloads, out-of-bounds indexes throw the normal Java exception. With FLAGS overloads, flags may allow returning Java-null or defaultValue instead.
    jo A JsonObject whose property value (named propertyName) is expected to contain a JsonString to be parsed into a Java Boxed-Primitive.

    If the property is missing, contains JsonValue.NULL, contains the wrong JSON type, or the parse fails, behavior is controlled by isOptional (for no-flags overloads) or FLAGS (for flags method overloads).
    propertyName The name of the JsonObject property to retrieve from jo and parse.

    Missing-property behavior is controlled by isOptional (no-flags overloads) or by FLAGS (flags overloads).
    isOptional Used by the “no-flags” JsonObject method overloads.

    When true and jo does not contain propertyName, the method returns Java-null.

    When false and the property is missing, an exception is thrown.

    (For flags-based overloads, this parameter is not used; FLAGS controls the “return null / return default / throw” decisions.)
    FLAGS A bit-mask of JFlag constants that alters parse behavior and error-handling behavior.

    When FLAGS is 0, the “normal” behavior applies (exceptions are thrown for missing property, null, wrong JSON type, parse failure, etc.).

    When flags are supplied, certain edge-cases may return Java-null or return defaultValue instead of throwing. This includes (depending on flags) zero-length strings, parse failures, null values, wrong JSON types, and other cases handled by your flag set.

    See the “Default-Value Flags” / “Flags Master List” documentation for the authoritative per-flag meaning in class JFlag
    defaultValue A Java <PRIMITIVE> fallback value that may be returned by the FLAGS-method overloads.

    If the selected flags request a “default-value return” for some parse/edge-case, 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 of defaultValue is the matching primitive type. Java's "Auto-Boxing" and "Auto Un-Boxing" makes this easy.
    optionalParser A user-supplied parsing function: Function<String, BOXED_TYPE>.

    If non-null, this function is used to convert the JsonString content into the target Java boxed value (example: parse an integer from a string).

    This is intended for cases where the default parsing logic is insufficient (special formats, custom numeric rules, locale-sensitive parsing, etc.), or where you simply want to override parsing behavior.

    Some method overloads name this parameter parser rather than optionalParser; it is the same concept.


    Single Character:
    Note that this class simply doesn't support any methods for reading a java.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



    Stateless Class:
    This class neither contains any program-state, nor can it be instantiated. The @StaticFunctional Annotation may also be called 'The Spaghetti Report'. Static-Functional classes are, essentially, C-Styled Files, without any constructors or non-static member fields. It is a concept very similar to the Java-Bean's @Stateless Annotation.

    • 1 Constructor(s), 1 declared private, zero-argument constructor
    • 32 Method(s), 32 declared static
    • 0 Field(s)


    • Method Summary

       
      No Control Flags: Retrieve a JsonString from a JsonArray and Parse into a Java Boxed-Primitive
      Modifier and Type Method
      static Boolean parseBoolean​(JsonArray ja, int i)
      static Byte parseByte​(JsonArray ja, int index)
      static Double parseDouble​(JsonArray ja, int index)
      static Float parseFloat​(JsonArray ja, int index)
      static Integer parseInteger​(JsonArray ja, int index)
      static Long parseLong​(JsonArray ja, int index)
      static Short parseShort​(JsonArray ja, int index)
       
      No Control Flags: Retrieve a JsonString from a JsonObject and Parse into a Java Boxed-Primitive
      Modifier and Type Method
      static Boolean parseBoolean​(JsonObject jo, String propertyName, boolean isOptional)
      static Byte parseByte​(JsonObject jo, String propertyName, boolean isOptional)
      static Double parseDouble​(JsonObject jo, String propertyName, boolean isOptional)
      static Float parseFloat​(JsonObject jo, String propertyName, boolean isOptional)
      static Integer parseInteger​(JsonObject jo, String propertyName, boolean isOptional)
      static Long parseLong​(JsonObject jo, String propertyName, boolean isOptional)
      static Short parseShort​(JsonObject jo, String propertyName, boolean isOptional)
       
      Using Error Control Flags: Retrieve a JsonString from a JsonArray and Parse into a Java Boxed-Primitive
      Modifier and Type Method
      static Boolean parseBoolean​(JsonArray ja, int index, int FLAGS, boolean defaultValue, Function<String,​Boolean> optionalParser)
      static Byte parseByte​(JsonArray ja, int index, int FLAGS, byte defaultValue, Function<String,​Byte> optionalParser)
      static Double parseDouble​(JsonArray ja, int index, int FLAGS, double defaultValue, Function<String,​Double> optionalParser)
      static Float parseFloat​(JsonArray ja, int index, int FLAGS, float defaultValue, Function<String,​Float> optionalParser)
      static Integer parseInteger​(JsonArray ja, int index, int FLAGS, int defaultValue, Function<String,​Integer> optionalParser)
      static Long parseLong​(JsonArray ja, int index, int FLAGS, long defaultValue, Function<String,​Long> optionalParser)
      static Short parseShort​(JsonArray ja, int index, int FLAGS, short defaultValue, Function<String,​Short> optionalParser)
       
      Using Error Control Flags: Retrieve a JsonString from a JsonObject and Parse into a Java Boxed-Primitive
      Modifier and Type Method
      static Boolean parseBoolean​(JsonObject jo, String propertyName, int FLAGS, boolean defaultValue, Function<String,​Boolean> optionalParser)
      static Byte parseByte​(JsonObject jo, String propertyName, int FLAGS, byte defaultValue, Function<String,​Byte> optionalParser)
      static Double parseDouble​(JsonObject jo, String propertyName, int FLAGS, double defaultValue, Function<String,​Double> optionalParser)
      static Float parseFloat​(JsonObject jo, String propertyName, int FLAGS, float defaultValue, Function<String,​Float> optionalParser)
      static Integer parseInteger​(JsonObject jo, String propertyName, int FLAGS, int defaultValue, Function<String,​Integer> optionalParser)
      static Long parseLong​(JsonObject jo, String propertyName, int FLAGS, long defaultValue, Function<String,​Long> optionalParser)
      static Short parseShort​(JsonObject jo, String propertyName, int FLAGS, short defaultValue, Function<String,​Short> optionalParser)
       
      Internal Use Only, Protected: General Purpose Parse Methods
      Modifier and Type Method
      protected static <T extends Number>
      T
      PARSE​(JsonArray ja, int index, int FLAGS, T defaultValue, Class<T> returnClass, Function<String,​T> optionalParser, Function<BigDecimal,​T> defaultParser1, Function<BigDecimal,​T> defaultParser2)
      protected static <T extends Number>
      T
      PARSE​(JsonObject jo, String propertyName, int FLAGS, T defaultValue, Class<T> returnClass, Function<String,​T> optionalParser, Function<BigDecimal,​T> defaultParser1, Function<BigDecimal,​T> defaultParser2)
      protected static <T extends Number>
      T
      PARSE_NO_FLAGS​(JsonArray ja, int index, Class<T> returnClass, Function<String,​T> parser)
      protected static <T extends Number>
      T
      PARSE_NO_FLAGS​(JsonObject jo, String propertyName, boolean isOptional, Class<T> returnClass, Function<String,​T> parser)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • parseInteger

        🡇     🗕  🗗  🗖
        public static java.lang.Integer parseInteger​
                    (JsonArray ja,
                     int index,
                     int FLAGS,
                     int defaultValue,
                     java.util.function.Function<java.lang.String,​java.lang.Integer> optionalParser)
        
        Retrieve a JsonString from a JsonArray index, and parse to a Boxed-Integer
        Accepts: a JsonArray, along with an array index.
        Flags: Accepts Error-Control Flags; May be configured to suppress exceptions.
        Throws: Please review documentation for PARSE method, listed below.
        Returns: A Java Boxed Integer (java.lang.Integer)
        See Also:
        PARSE(JsonArray, int, int, Number, Class, Function, Function, Function)
        Code:
        Exact Method Body:
         return PARSE(
             ja, index, FLAGS, defaultValue, Integer.class, optionalParser,
             BigDecimal::intValueExact, BigDecimal::intValue
         );
        
      • parseLong

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Long parseLong​
                    (JsonArray ja,
                     int index,
                     int FLAGS,
                     long defaultValue,
                     java.util.function.Function<java.lang.String,​java.lang.Long> optionalParser)
        
        Retrieve a JsonString from a JsonArray index, and parse to a Boxed Long Integer
        Accepts: a JsonArray, along with an array index.
        Flags: Accepts Error-Control Flags; May be configured to suppress exceptions.
        Throws: Please review documentation for PARSE method, listed below.
        Returns: A Java Boxed Long (java.lang.Long)
        See Also:
        PARSE(JsonArray, int, int, Number, Class, Function, Function, Function)
        Code:
        Exact Method Body:
         return PARSE(
             ja, index, FLAGS, defaultValue, Long.class, optionalParser,
             BigDecimal::longValueExact, BigDecimal::longValue
         );
        
      • parseShort

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Short parseShort​
                    (JsonArray ja,
                     int index,
                     int FLAGS,
                     short defaultValue,
                     java.util.function.Function<java.lang.String,​java.lang.Short> optionalParser)
        
        Retrieve a JsonString from a JsonArray index, and parse to a Boxed Short Integer
        Accepts: a JsonArray, along with an array index.
        Flags: Accepts Error-Control Flags; May be configured to suppress exceptions.
        Throws: Please review documentation for PARSE method, listed below.
        Returns: A Java Boxed Integer (java.lang.Integer)
        See Also:
        PARSE(JsonArray, int, int, Number, Class, Function, Function, Function)
        Code:
        Exact Method Body:
         return PARSE(
             ja, index, FLAGS, defaultValue, Short.class, optionalParser,
             BigDecimal::shortValueExact, BigDecimal::shortValue
         );
        
      • parseByte

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Byte parseByte​
                    (JsonArray ja,
                     int index,
                     int FLAGS,
                     byte defaultValue,
                     java.util.function.Function<java.lang.String,​java.lang.Byte> optionalParser)
        
        Retrieve a JsonString from a JsonArray index, and parse to a Boxed-Byte
        Accepts: a JsonArray, along with an array index.
        Flags: Accepts Error-Control Flags; May be configured to suppress exceptions.
        Throws: Please review documentation for PARSE method, listed below.
        Returns: A Java Boxed Integer (java.lang.Integer)
        See Also:
        PARSE(JsonArray, int, int, Number, Class, Function, Function, Function)
        Code:
        Exact Method Body:
         return PARSE(
             ja, index, FLAGS, defaultValue, Byte.class, optionalParser,
             BigDecimal::byteValueExact, BigDecimal::byteValue
         );
        
      • parseDouble

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Double parseDouble​
                    (JsonArray ja,
                     int index,
                     int FLAGS,
                     double defaultValue,
                     java.util.function.Function<java.lang.String,​java.lang.Double> optionalParser)
        
        Retrieve a JsonString from a JsonArray index, and parse to a Boxed-Double
        Accepts: a JsonArray, along with an array index.
        Flags: Accepts Error-Control Flags; May be configured to suppress exceptions.
        Throws: Please review documentation for PARSE method, listed below.
        Returns: A Java Boxed Integer (java.lang.Integer)
        See Also:
        PARSE(JsonArray, int, int, Number, Class, Function, Function, Function)
        Code:
        Exact Method Body:
         return PARSE(
             ja, index, FLAGS, defaultValue, Double.class, optionalParser,
             RJInternal::DOUBLE_WITH_CHECK, BigDecimal::doubleValue
         );
        
      • parseFloat

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Float parseFloat​
                    (JsonArray ja,
                     int index,
                     int FLAGS,
                     float defaultValue,
                     java.util.function.Function<java.lang.String,​java.lang.Float> optionalParser)
        
        Retrieve a JsonString from a JsonArray index, and parse to a Boxed-Float
        Accepts: a JsonArray, along with an array index.
        Flags: Accepts Error-Control Flags; May be configured to suppress exceptions.
        Throws: Please review documentation for PARSE method, listed below.
        Returns: A Java Boxed Integer (java.lang.Integer)
        See Also:
        PARSE(JsonArray, int, int, Number, Class, Function, Function, Function)
        Code:
        Exact Method Body:
         return PARSE(
             ja, index, FLAGS, defaultValue, Float.class, optionalParser,
             RJInternal::FLOAT_WITH_CHECK, BigDecimal::floatValue
         );
        
      • parseInteger

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Integer parseInteger​
                    (JsonObject jo,
                     java.lang.String propertyName,
                     int FLAGS,
                     int defaultValue,
                     java.util.function.Function<java.lang.String,​java.lang.Integer> optionalParser)
        
        Retrieve a JsonString from a JsonObject property, and parse to a Boxed-Integer
        Accepts: a JsonObject, along with property name, as a java.lang.String
        Flags: Accepts Error-Control Flags; May be configured to suppress exceptions.
        Throws: Please review documentation for PARSE method, listed below.
        Returns: A Java Boxed Integer (java.lang.Integer)
        See Also:
        PARSE(JsonObject, String, int, Number, Class, Function, Function, Function)
        Code:
        Exact Method Body:
         return PARSE(
             jo, propertyName, FLAGS, defaultValue, Integer.class, optionalParser,
             BigDecimal::intValueExact, BigDecimal::intValue
         );
        
      • parseLong

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Long parseLong​
                    (JsonObject jo,
                     java.lang.String propertyName,
                     int FLAGS,
                     long defaultValue,
                     java.util.function.Function<java.lang.String,​java.lang.Long> optionalParser)
        
        Retrieve a JsonString from a JsonObject property, and parse to a Boxed Long Integer
        Accepts: a JsonObject, along with property name, as a java.lang.String
        Flags: Accepts Error-Control Flags; May be configured to suppress exceptions.
        Throws: Please review documentation for PARSE method, listed below.
        Returns: A Java Boxed Long (java.lang.Long)
        See Also:
        PARSE(JsonObject, String, int, Number, Class, Function, Function, Function)
        Code:
        Exact Method Body:
         return PARSE(
             jo, propertyName, FLAGS, defaultValue, Long.class, optionalParser,
             BigDecimal::longValueExact, BigDecimal::longValue
         );
        
      • parseShort

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Short parseShort​
                    (JsonObject jo,
                     java.lang.String propertyName,
                     int FLAGS,
                     short defaultValue,
                     java.util.function.Function<java.lang.String,​java.lang.Short> optionalParser)
        
        Retrieve a JsonString from a JsonObject property, and parse to a Boxed Short Integer
        Accepts: a JsonObject, along with property name, as a java.lang.String
        Flags: Accepts Error-Control Flags; May be configured to suppress exceptions.
        Throws: Please review documentation for PARSE method, listed below.
        Returns: A Java Boxed Short (java.lang.Short)
        See Also:
        PARSE(JsonObject, String, int, Number, Class, Function, Function, Function)
        Code:
        Exact Method Body:
         return PARSE(
             jo, propertyName, FLAGS, defaultValue, Short.class, optionalParser,
             BigDecimal::shortValueExact, BigDecimal::shortValue
         );
        
      • parseByte

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Byte parseByte​
                    (JsonObject jo,
                     java.lang.String propertyName,
                     int FLAGS,
                     byte defaultValue,
                     java.util.function.Function<java.lang.String,​java.lang.Byte> optionalParser)
        
        Retrieve a JsonString from a JsonObject property, and parse to a Boxed-Byte
        Accepts: a JsonObject, along with property name, as a java.lang.String
        Flags: Accepts Error-Control Flags; May be configured to suppress exceptions.
        Throws: Please review documentation for PARSE method, listed below.
        Returns: A Java Boxed Byte (java.lang.Byte)
        See Also:
        PARSE(JsonObject, String, int, Number, Class, Function, Function, Function)
        Code:
        Exact Method Body:
         return PARSE(
             jo, propertyName, FLAGS, defaultValue, Byte.class, optionalParser,
             BigDecimal::byteValueExact, BigDecimal::byteValue
         );
        
      • parseDouble

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Double parseDouble​
                    (JsonObject jo,
                     java.lang.String propertyName,
                     int FLAGS,
                     double defaultValue,
                     java.util.function.Function<java.lang.String,​java.lang.Double> optionalParser)
        
        Retrieve a JsonString from a JsonObject property, and parse to a Boxed-Double
        Accepts: a JsonObject, along with property name, as a java.lang.String
        Flags: Accepts Error-Control Flags; May be configured to suppress exceptions.
        Throws: Please review documentation for PARSE method, listed below.
        Returns: A Java Boxed Double (java.lang.Double)
        See Also:
        PARSE(JsonObject, String, int, Number, Class, Function, Function, Function)
        Code:
        Exact Method Body:
         return PARSE(
             jo, propertyName, FLAGS, defaultValue, Double.class, optionalParser,
             RJInternal::DOUBLE_WITH_CHECK, BigDecimal::doubleValue
         );
        
      • parseFloat

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Float parseFloat​
                    (JsonObject jo,
                     java.lang.String propertyName,
                     int FLAGS,
                     float defaultValue,
                     java.util.function.Function<java.lang.String,​java.lang.Float> optionalParser)
        
        Retrieve a JsonString from a JsonObject property, and parse to a Boxed-Float
        Accepts: a JsonObject, along with property name, as a java.lang.String
        Flags: Accepts Error-Control Flags; May be configured to suppress exceptions.
        Throws: Please review documentation for PARSE method, listed below.
        Returns: A Java Boxed Float (java.lang.Float)
        See Also:
        PARSE(JsonObject, String, int, Number, Class, Function, Function, Function)
        Code:
        Exact Method Body:
         return PARSE(
             jo, propertyName, FLAGS, defaultValue, Float.class, optionalParser,
             RJInternal::FLOAT_WITH_CHECK, BigDecimal::floatValue
         );
        
      • parseInteger

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Integer parseInteger​(JsonArray ja,
                                                     int index)
        Retrieve a JsonString from a JsonArray index, and parse to a Boxed-Integer
        Accepts: a JsonArray, along with an array index.
        Flags: Does not accept user configuration flags. Instead, throws all default exceptions on error.
        Throws: Please review documentation for PARSE_NO_FLAGS method, listed below.
        Returns: A Java Boxed Integer (java.lang.Integer)
        See Also:
        PARSE(JsonObject, String, int, Number, Class, Function, Function, Function)
        Code:
        Exact Method Body:
         return PARSE_NO_FLAGS(ja, index, Integer.class, Integer::parseInt);
        
      • parseLong

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Long parseLong​(JsonArray ja,
                                               int index)
        Retrieve a JsonString from a JsonArray index, and parse to a Boxed Long Integer
        Accepts: a JsonArray, along with an array index.
        Flags: Does not accept user configuration flags. Instead, throws all default exceptions on error.
        Throws: Please review documentation for PARSE_NO_FLAGS method, listed below.
        Returns: A Java Boxed Long (java.lang.Long)
        See Also:
        PARSE_NO_FLAGS(JsonArray, int, Class, Function)
        Code:
        Exact Method Body:
         return PARSE_NO_FLAGS(ja, index, Long.class, Long::parseLong);
        
      • parseShort

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Short parseShort​(JsonArray ja,
                                                 int index)
        Retrieve a JsonString from a JsonArray index, and parse to a Boxed Short Integer
        Accepts: a JsonArray, along with an array index.
        Flags: Does not accept user configuration flags. Instead, throws all default exceptions on error.
        Throws: Please review documentation for PARSE_NO_FLAGS method, listed below.
        Returns: A Java Boxed Short (java.lang.Short)
        See Also:
        PARSE_NO_FLAGS(JsonArray, int, Class, Function)
        Code:
        Exact Method Body:
         return PARSE_NO_FLAGS(ja, index, Short.class, Short::parseShort);
        
      • parseByte

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Byte parseByte​(JsonArray ja,
                                               int index)
        Retrieve a JsonString from a JsonArray index, and parse to a Boxed-Byte
        Accepts: a JsonArray, along with an array index.
        Flags: Does not accept user configuration flags. Instead, throws all default exceptions on error.
        Throws: Please review documentation for PARSE_NO_FLAGS method, listed below.
        Returns: A Java Boxed Byte (java.lang.Byte)
        See Also:
        PARSE_NO_FLAGS(JsonArray, int, Class, Function)
        Code:
        Exact Method Body:
         return PARSE_NO_FLAGS(ja, index, Byte.class, Byte::parseByte);
        
      • parseDouble

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Double parseDouble​(JsonArray ja,
                                                   int index)
        Retrieve a JsonString from a JsonArray index, and parse to a Boxed-Double
        Accepts: a JsonArray, along with an array index.
        Flags: Does not accept user configuration flags. Instead, throws all default exceptions on error.
        Throws: Please review documentation for PARSE_NO_FLAGS method, listed below.
        Returns: A Java Boxed Double (java.lang.Double)
        See Also:
        PARSE_NO_FLAGS(JsonArray, int, Class, Function)
        Code:
        Exact Method Body:
         return PARSE_NO_FLAGS(ja, index, Double.class, Double::parseDouble);
        
      • parseFloat

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Float parseFloat​(JsonArray ja,
                                                 int index)
        Retrieve a JsonString from a JsonArray index, and parse to a Boxed-Float
        Accepts: a JsonArray, along with an array index.
        Flags: Does not accept user configuration flags. Instead, throws all default exceptions on error.
        Throws: Please review documentation for PARSE_NO_FLAGS method, listed below.
        Returns: A Java Boxed Float (java.lang.Float)
        See Also:
        PARSE_NO_FLAGS(JsonArray, int, Class, Function)
        Code:
        Exact Method Body:
         return PARSE_NO_FLAGS(ja, index, Float.class, Float::parseFloat);
        
      • parseInteger

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Integer parseInteger​(JsonObject jo,
                                                     java.lang.String propertyName,
                                                     boolean isOptional)
        Retrieve a JsonString from a JsonObject property, and parse to a Boxed-Integer
        Accepts: a JsonObject, along with property name, as a java.lang.String
        Flags: Does not accept user configuration flags. Instead, throws all default exceptions on error.
        Throws: Please review documentation for PARSE_NO_FLAGS method, listed below.
        Returns: A Java Boxed Integer (java.lang.Integer)
        See Also:
        PARSE_NO_FLAGS(JsonObject, String, boolean, Class, Function)
        Code:
        Exact Method Body:
         return PARSE_NO_FLAGS(jo, propertyName, isOptional, Integer.class, Integer::parseInt);
        
      • parseLong

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Long parseLong​(JsonObject jo,
                                               java.lang.String propertyName,
                                               boolean isOptional)
        Retrieve a JsonString from a JsonObject property, and parse to a Boxed Long Integer
        Accepts: a JsonObject, along with property name, as a java.lang.String
        Flags: Does not accept user configuration flags. Instead, throws all default exceptions on error.
        Throws: Please review documentation for PARSE_NO_FLAGS method, listed below.
        Returns: A Java Boxed Long (java.lang.Long)
        See Also:
        PARSE_NO_FLAGS(JsonObject, String, boolean, Class, Function)
        Code:
        Exact Method Body:
         return PARSE_NO_FLAGS(jo, propertyName, isOptional, Long.class, Long::parseLong);
        
      • parseShort

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Short parseShort​(JsonObject jo,
                                                 java.lang.String propertyName,
                                                 boolean isOptional)
        Retrieve a JsonString from a JsonObject property, and parse to a Boxed Short Integer
        Accepts: a JsonObject, along with property name, as a java.lang.String
        Flags: Does not accept user configuration flags. Instead, throws all default exceptions on error.
        Throws: Please review documentation for PARSE_NO_FLAGS method, listed below.
        Returns: A Java Boxed Short (java.lang.Short)
        See Also:
        PARSE_NO_FLAGS(JsonObject, String, boolean, Class, Function)
        Code:
        Exact Method Body:
         return PARSE_NO_FLAGS(jo, propertyName, isOptional, Short.class, Short::parseShort);
        
      • parseByte

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Byte parseByte​(JsonObject jo,
                                               java.lang.String propertyName,
                                               boolean isOptional)
        Retrieve a JsonString from a JsonObject property, and parse to a Boxed-Byte
        Accepts: a JsonObject, along with property name, as a java.lang.String
        Flags: Does not accept user configuration flags. Instead, throws all default exceptions on error.
        Throws: Please review documentation for PARSE_NO_FLAGS method, listed below.
        Returns: A Java Boxed Byte (java.lang.Byte)
        See Also:
        PARSE_NO_FLAGS(JsonObject, String, boolean, Class, Function)
        Code:
        Exact Method Body:
         return PARSE_NO_FLAGS(jo, propertyName, isOptional, Byte.class, Byte::parseByte);
        
      • parseDouble

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Double parseDouble​(JsonObject jo,
                                                   java.lang.String propertyName,
                                                   boolean isOptional)
        Retrieve a JsonString from a JsonObject property, and parse to a Boxed-Double
        Accepts: a JsonObject, along with property name, as a java.lang.String
        Flags: Does not accept user configuration flags. Instead, throws all default exceptions on error.
        Throws: Please review documentation for PARSE_NO_FLAGS method, listed below.
        Returns: A Java Boxed Double (java.lang.Double)
        See Also:
        PARSE_NO_FLAGS(JsonObject, String, boolean, Class, Function)
        Code:
        Exact Method Body:
         return PARSE_NO_FLAGS(jo, propertyName, isOptional, Double.class, Double::parseDouble);
        
      • parseFloat

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Float parseFloat​(JsonObject jo,
                                                 java.lang.String propertyName,
                                                 boolean isOptional)
        Retrieve a JsonString from a JsonObject property, and parse to a Boxed-Float
        Accepts: a JsonObject, along with property name, as a java.lang.String
        Flags: Does not accept user configuration flags. Instead, throws all default exceptions on error.
        Throws: Please review documentation for PARSE_NO_FLAGS method, listed below.
        Returns: A Java Boxed Float (java.lang.Float)
        See Also:
        PARSE_NO_FLAGS(JsonObject, String, boolean, Class, Function)
        Code:
        Exact Method Body:
         return PARSE_NO_FLAGS(jo, propertyName, isOptional, Float.class, Float::parseFloat);
        
      • parseBoolean

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Boolean parseBoolean​
                    (JsonArray ja,
                     int index,
                     int FLAGS,
                     boolean defaultValue,
                     java.util.function.Function<java.lang.String,​java.lang.Boolean> optionalParser)
        
        Retrieve a JsonString from a JsonArray index, and parse to a Boxed-Boolean
        Accepts: a JsonArray, along with an array index.
        Flags: Accepts Error-Control Flags; May be configured to suppress exceptions.
        Throws: Please review documentation for PARSE method, listed below.
        Returns: A Java Boxed Boolean (java.lang.Boolean)
        Code:
        Exact Method Body:
         if (index >= ja.size()) return IOOBEX(ja, index, defaultValue, FLAGS);
        
         final JsonValue jv = ja.get(index);
        
         switch (jv.getValueType())
         {
             case NULL: return JNAEX(ja, index, defaultValue, FLAGS, STRING, Boolean.class);
        
             case STRING:
        
                 final String s = ((JsonString) jv).getString();
        
                 if (s.length() == 0)
                 {
                     if ((FLAGS & RETURN_NULL_ON_0LEN_STR) != 0)     return null;
                     if ((FLAGS & RETURN_DEFVAL_ON_0LEN_STR) != 0)   return defaultValue;
                     if ((FLAGS & RETURN_NULL_ON_ANY_ALL) != 0)      return null;
                     if ((FLAGS & RETURN_DEFVAL_ON_ANY_ALL) != 0)    return defaultValue;
                 }
        
                 try
                 {
                     return (optionalParser != null)
                         ? optionalParser.apply(s)
                         : Boolean.parseBoolean(s.trim());
                 }
        
                 catch (Exception e)
                     { return JSPAEX(e, ja, index, defaultValue, FLAGS, jv, Boolean.class); }
        
             default: return JTAEX(ja, index, defaultValue, FLAGS, STRING, jv, Boolean.class);
         }
        
      • parseBoolean

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Boolean parseBoolean​
                    (JsonObject jo,
                     java.lang.String propertyName,
                     int FLAGS,
                     boolean defaultValue,
                     java.util.function.Function<java.lang.String,​java.lang.Boolean> optionalParser)
        
        Retrieve a JsonString from a JsonObject property, and parse to a Boxed-Integer
        Accepts: a JsonObject, along with property name, as a java.lang.String
        Flags: Accepts Error-Control Flags; May be configured to suppress exceptions.
        Throws: Please review documentation for PARSE method, listed below.
        Returns: A Java Boxed Boolean (java.lang.Boolean)
        Code:
        Exact Method Body:
         final JsonValue jv = jo.get(propertyName);
        
         if (jv == null) return JPMEX(jo, propertyName, defaultValue, FLAGS, STRING, Boolean.class);
        
         switch (jv.getValueType())
         {
             case NULL: return JNOEX(jo, propertyName, defaultValue, FLAGS, STRING, Boolean.class);
        
             case STRING:
        
                 final String s = ((JsonString) jv).getString();
        
                 if (s.length() == 0)
                 {
                     if ((FLAGS & RETURN_NULL_ON_0LEN_STR) != 0)     return null;
                     if ((FLAGS & RETURN_DEFVAL_ON_0LEN_STR) != 0)   return defaultValue;
                     if ((FLAGS & RETURN_NULL_ON_ANY_ALL) != 0)      return null;
                     if ((FLAGS & RETURN_DEFVAL_ON_ANY_ALL) != 0)    return defaultValue;
                 }
        
                 try
                 {
                     return (optionalParser != null)
                         ? optionalParser.apply(s)
                         : Boolean.parseBoolean(s.trim());
                 }
        
                 catch (Exception e)
                     { return JSPOEX(e, jo, propertyName, defaultValue, FLAGS, jv, Boolean.class); }
        
             default: return JTOEX(jo, propertyName, defaultValue, FLAGS, STRING, jv, Boolean.class);
         }
        
      • parseBoolean

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Boolean parseBoolean​(JsonArray ja,
                                                     int i)
        Retrieve a JsonString from a JsonArray index, and parse to a Boxed-Boolean
        Accepts: a JsonArray, along with an array index.
        Flags: Does not accept user configuration flags. Instead, throws all default exceptions on error.
        Throws: Please review documentation for PARSE_NO_FLAGS method, listed below.
        Returns: A Java Boxed Boolean (java.lang.Boolean)
        Code:
        Exact Method Body:
         // Throws an IndexOutOfBoundsException
         final JsonValue jv = ja.get(i);
        
         switch (jv.getValueType())
         {
             case NULL: return null;
        
             case STRING:
        
                 try
                     { return Boolean.parseBoolean(((JsonString) jv).getString()); }
        
                 catch (Exception e)
                     { throw new JsonStrParseArrException (e, ja, i, jv, Boolean.class); }
        
             default: throw new JsonTypeArrException(ja, i, STRING, jv, Boolean.class);
         }
        
      • parseBoolean

        🡅  🡇     🗕  🗗  🗖
        public static java.lang.Boolean parseBoolean​(JsonObject jo,
                                                     java.lang.String propertyName,
                                                     boolean isOptional)
        Retrieve a JsonString from a JsonObject property, and parse to a Boxed-Integer
        Accepts: a JsonObject, along with property name, as a java.lang.String
        Flags: Does not accept user configuration flags. Instead, throws all default exceptions on error.
        Throws: Please review documentation for PARSE_NO_FLAGS method, listed below.
        Returns: A Java Boxed Boolean (java.lang.Boolean)
        Code:
        Exact Method Body:
         final JsonValue jv = jo.get(propertyName);
        
         if (jv == null)
         {
             if (isOptional) return null;
             else            throw new JsonPropMissingException(jo, propertyName, STRING, Boolean.class);
         }
        
         switch (jv.getValueType())
         {
             case NULL: return null;
        
             case STRING:
        
                 try
                     { return Boolean.parseBoolean(((JsonString) jv).getString()); }
        
                 catch (Exception e)
                     { throw new JsonStrParseObjException(e, jo, propertyName, jv, Boolean.class); }
        
             default: throw new JsonTypeObjException(jo, propertyName, STRING, jv, Boolean.class);
         }
        
      • PARSE

        🡅  🡇     🗕  🗗  🗖
        protected static <T extends java.lang.Number> T PARSE​
                    (JsonArray ja,
                     int index,
                     int FLAGS,
                     T defaultValue,
                     java.lang.Class<T> returnClass,
                     java.util.function.Function<java.lang.String,​T> optionalParser,
                     java.util.function.Function<java.math.BigDecimal,​T> defaultParser1,
                     java.util.function.Function<java.math.BigDecimal,​T> defaultParser2)
        
        Retrieve a JsonArray element containing a JsonString, and transform it to a Java Type, with either a user-provided parser, or the standard java parser for that class (passed as a parameter).
        Type Parameters:
        T - The type of the returned value
        Parameters:
        ja - Any instance of JsonArray
        index - array-index containing the JsonString to retrieve.
        FLAGS - The return-value / exception-throw flag constants defined in JFlag
        defaultValue - User-provided default-value, only returned if flags are set.
        optionalParser - A valid String -> 'T' parser. This parameter may be null.
        defaultParser1 - Default String -> 'T' parser.
        defaultParser2 - String -> 'T' parser, that will round on Arithmetic Exceptions
        Returns:
        On success, this method returns the converted type.
        Throws:
        JsonPropMissingException - 'jo' doesn't have 'propertyName', unless flags are set.
        JsonArithmeticArrException - after parse, conversion fails, and flags aren't set
        JsonStrParseArrException - parser-failure unless flags are set
        JsonNullArrException - property contains null, unless flags are set
        JsonTypeArrException - property doesn't contain JsonString, unless flags are set.
        See Also:
        parseInteger(JsonArray, int, int, int, Function), parseLong(JsonArray, int, int, long, Function), parseShort(JsonArray, int, int, short, Function), parseByte(JsonArray, int, int, byte, Function), parseDouble(JsonArray, int, int, double, Function), parseFloat(JsonArray, int, int, float, Function), ReadNumberJSON.parse(JsonArray, int, int, Number, Function), RJInternal.IOOBEX(JsonArray, int, Object, int), RJInternal.JNAEX(JsonArray, int, Object, int, JsonValue.ValueType, Class), RJInternal.JSPAEX(Exception, JsonArray, int, Object, int, JsonValue, Class), RJInternal.JTAEX(JsonArray, int, Object, int, JsonValue.ValueType, JsonValue, Class)
        Code:
        Exact Method Body:
         // When TRUE, the index provided turned out to be outside of the bounds of the array.  The
         // IndexOutOfBounds "handler" (the method called here) will check the FLAGS, and:
         //
         //  1) return the defaultValue (if Requested by 'FLAGS' for IOOBEX)
         //  2) return null (if Requested by 'FLAGS' for IOOBEX)
         //  3) throw IndexOutOfBoundsException
         //
         // NOTE: It is probably a "little less efficient" to turn this into a method call,
         //       since there are all these parameters that have to be passed, but this is
         //       trading "readability" (less head-aches) in exchange for efficiency.
         //
         // This point applies to all of the "Exception Flag Handlers" used here
        
         if (index >= ja.size()) return IOOBEX(ja, index, defaultValue, FLAGS);
        
         final JsonValue jv = ja.get(index);
        
         switch (jv.getValueType())
         {
             // When a 'NULL' (Json-Null) JsonValue is present, the JsonNullArrException 'handler'
             // will do one of the following:
             //
             //  1) return the defaultValue (if Requested by 'FLAGS' for JNAEX)
             //  2) return null (if Requested by 'FLAGS' for JNAEX)
             //  3) throw JsonNullArrException
        
             case NULL: return JNAEX(ja, index, defaultValue, FLAGS, STRING, returnClass);
        
             case STRING:
        
                 final String s = ((JsonString) jv).getString();
        
                 // NOTE: This isn't actually an "Exception Case", and if the user hasn't made
                 //       a request, the empty-string is passed to whatever parser is configured
        
                 if (s.length() == 0)
                 {
                     if ((FLAGS & RETURN_NULL_ON_0LEN_STR) != 0)     return null;
                     if ((FLAGS & RETURN_DEFVAL_ON_0LEN_STR) != 0)   return defaultValue;
                     if ((FLAGS & RETURN_NULL_ON_ANY_ALL) != 0)      return null;
                     if ((FLAGS & RETURN_DEFVAL_ON_ANY_ALL) != 0)    return defaultValue;
                 }
        
                 // Temp Variable, used in order not to invoke the BigDecimal contructor twice
                 BigDecimal bd = null;
        
                 try
                 {
                     // NOTE: 'bd' will not be null if "ArithmeticException" is thrown...
                     // new BigDecimal throws "NumberFormatException" is thrown
                     // optionalParser.apply can throw ArithmeticException
        
                     return (optionalParser != null)
                         ? optionalParser.apply(s)
                         : defaultParser1.apply(bd = new BigDecimal(s.trim()));
                 }
        
        
                 // Because
                 //
                 // 1) A method for this code would only be invoked here, and...
                 // 2) And because there would be 9 parameters to pass, 
                 // 3) the 'inline' version of "Flag Handler" is left here!
                 //
                 // NOTE: All four "JsonArithmetic Arr/Obj Exception" exception throws
                 //       are different for each of the 4 methods where they are used.
        
                 catch (ArithmeticException ae)
                 {
                     if ((FLAGS & RETURN_NULL_ON_AEX) != 0)          return null;
                     if ((FLAGS & RETURN_DEFVAL_ON_AEX) != 0)        return defaultValue;
                     if ((FLAGS & RETURN_JAPPROX_ON_AEX) != 0)       return defaultParser2.apply(bd);
                     if ((FLAGS & RETURN_NULL_ON_ANY_ALL) != 0)      return null;
                     if ((FLAGS & RETURN_DEFVAL_ON_ANY_ALL) != 0)    return defaultValue;
        
                     throw new JsonArithmeticArrException(ae, ja, index, STRING, jv, returnClass);
                 }
        
        
                 // HANDLER STRIKES AGAIN! - but this time for "JsonStrParseArrException"
                 // RETURNS: null, or defaultValue, (otherwise throws JsonStrParseArrException)
        
                 catch (Exception e)
                     { return JSPAEX(e, ja, index, defaultValue, FLAGS, jv, returnClass); }
        
        
             // The JsonValue at the specified array-index does not contain an JsonString.
             // The "JsonTypeArrException Handler" will do one of these:
             //
             //  1) return the defaultValue (if Requested by 'FLAGS' for JTAEX)
             //  2) return null (if Requested by 'FLAGS' for JTAEX)
             //  3) throw JsonTypeArrException
        
             default: return JTAEX(ja, index, defaultValue, FLAGS, STRING, jv, returnClass);
         }
        
      • PARSE

        🡅  🡇     🗕  🗗  🗖
        protected static <T extends java.lang.Number> T PARSE​
                    (JsonObject jo,
                     java.lang.String propertyName,
                     int FLAGS,
                     T defaultValue,
                     java.lang.Class<T> returnClass,
                     java.util.function.Function<java.lang.String,​T> optionalParser,
                     java.util.function.Function<java.math.BigDecimal,​T> defaultParser1,
                     java.util.function.Function<java.math.BigDecimal,​T> defaultParser2)
        
        Retrieve a JsonObject property containing a JsonString, and transform it to a Java Type, with either a user-provided parser, or the standard java parser for that class (passed as a parameter).
        Type Parameters:
        T - The type of the returned value.
        Parameters:
        jo - Any instance of JsonObject
        propertyName - propertyName containing the JsonString to retrieve.
        FLAGS - The return-value / exception-throw flag constants defined in JFlag
        defaultValue - User-provided default-value, only returned if flags are set.
        optionalParser - A valid String -> 'T' parser. This parameter may be null.
        defaultParser1 - Default String -> 'T' parser.
        defaultParser2 - String -> 'T' parser, that will round on Arithmetic Exceptions
        Returns:
        On success, this method returns the converted type instance.
        Throws:
        JsonPropMissingException - 'jo' doesn't have 'propertyName', unless flags are set.
        JsonArithmeticObjException - after parse, conversion fails, and flags aren't set
        JsonStrParseObjException - parser-failure unless flags are set
        JsonNullObjException - property contains null, unless flags are set
        JsonTypeObjException - property doesn't contain JsonString, unless flags are set.
        See Also:
        parseInteger(JsonObject, String, int, int, Function), parseLong(JsonObject, String, int, long, Function), parseShort(JsonObject, String, int, short, Function), parseByte(JsonObject, String, int, byte, Function), parseDouble(JsonObject, String, int, double, Function), parseFloat(JsonObject, String, int, float, Function), ReadNumberJSON.parse(JsonObject, String, int, Number, Function), RJInternal.JPMEX(JsonObject, String, Object, int, JsonValue.ValueType, Class), RJInternal.JNOEX(JsonObject, String, Object, int, JsonValue.ValueType, Class), RJInternal.JSPOEX(Exception, JsonObject, String, Object, int, JsonValue, Class), RJInternal.JTOEX(JsonObject, String, Object, int, JsonValue.ValueType, JsonValue, Class)
        Code:
        Exact Method Body:
         final JsonValue jv = jo.get(propertyName);
        
        
         // When TRUE, the user-specified 'property' (named by 'propertyName') isn't actually one
         // of the listed properties inside the JsonObject.  The JsonPropMissingException "handler"
         // (the method called here) will check the FLAGS, and:
         //
         //  1) return the defaultValue (if Requested by 'FLAGS' for JPMEX)
         //  2) return null (if Requested by 'FLAGS' for JPMEX)
         //  3) throw JsonPropMissingException
         //
         // NOTE: It is probably a "little less efficient" to turn this into a method call,
         //       since there are all these parameters that have to be passed, but this is
         //       trading "readability" (less head-aches) in exchange for efficiency.
         //
         // This point applies to all of the "Exception Flag Handlers" used here
        
         if (jv == null) return JPMEX(jo, propertyName, defaultValue, FLAGS, STRING, returnClass);
        
         switch (jv.getValueType())
         {
             // When a 'NULL' (Json-Null) JsonValue is present, the JsonNullObjException 'handler'
             // will do one of the following:
             //
             //  1) return the defaultValue (if Requested by 'FLAGS' for JNOEX)
             //  2) return null (if Requested by 'FLAGS' for JNOEX)
             //  3) throw JsonNullArrException
        
             case NULL: return JNOEX(jo, propertyName, defaultValue, FLAGS, STRING, returnClass);
        
             case STRING:
        
                 final String s = ((JsonString) jv).getString();
        
        
                 // NOTE: This isn't actually an "Exception Case", and if the user hasn't made
                 //       a request, the empty-string is passed to whatever parser is configured
        
                 if (s.length() == 0)
                 {
                     if ((FLAGS & RETURN_NULL_ON_0LEN_STR) != 0)     return null;
                     if ((FLAGS & RETURN_DEFVAL_ON_0LEN_STR) != 0)   return defaultValue;
                     if ((FLAGS & RETURN_NULL_ON_ANY_ALL) != 0)      return null;
                     if ((FLAGS & RETURN_DEFVAL_ON_ANY_ALL) != 0)    return defaultValue;
                 }
        
                 // Temp Variable, used in order not to invoke the BigDecimal contructor twice
                 BigDecimal bd = null;
        
                 try
                 {
                     // NOTE: 'bd' will not be null if "ArithmeticException" is thrown...
                     // new BigDecimal throws "NumberFormatException" is thrown
                     // parsoptionalParserer.apply can throw ArithmeticException
        
                     return (optionalParser != null)
                         ? optionalParser.apply(s)
                         : defaultParser1.apply(bd = new BigDecimal(s.trim()));
                 }
        
        
                 // Because
                 //
                 // 1) A method for this code would only be invoked here, and...
                 // 2) And because there would be 9 parameters to pass, 
                 // 3) the 'inline' version of "Flag Handler" is left here!
                 //
                 // NOTE: All four "JsonArithmetic Arr/Obj Exception" exception throws
                 //       are different for each of the 4 methods where they are used.
        
                 catch (ArithmeticException ae)
                 {
                     if ((FLAGS & RETURN_NULL_ON_AEX) != 0)          return null;
                     if ((FLAGS & RETURN_DEFVAL_ON_AEX) != 0)        return defaultValue;
                     if ((FLAGS & RETURN_JAPPROX_ON_AEX) != 0)       return defaultParser2.apply(bd);
                     if ((FLAGS & RETURN_NULL_ON_ANY_ALL) != 0)      return null;
                     if ((FLAGS & RETURN_DEFVAL_ON_ANY_ALL) != 0)    return defaultValue;
        
                     throw new JsonArithmeticObjException
                         (ae, jo, propertyName, STRING, jv, returnClass);
                 }
        
        
                 // HANDLER STRIKES AGAIN! - but this time for "JsonStrParseObjException"
                 // RETURNS: null, or defaultValue, (otherwise throws JsonStrParseObjException)
        
                 catch (Exception e)
                     { return JSPOEX(e, jo, propertyName, defaultValue, FLAGS, jv, returnClass); }
        
        
             // The JsonValue of 'propertyName' does not contain an JsonString.
             // The "JsonTypeObjException Handler" will do one of these:
             //
             //  1) return the defaultValue (if Requested by 'FLAGS' for JTOEX)
             //  2) return null (if Requested by 'FLAGS' for JTOEX)
             //  3) throw JsonTypeObjException
        
             default: return JTOEX(jo, propertyName, defaultValue, FLAGS, STRING, jv, returnClass);
         }
        
      • PARSE_NO_FLAGS

        🡅  🡇     🗕  🗗  🗖
        protected static <T extends java.lang.Number> T PARSE_NO_FLAGS​
                    (JsonArray ja,
                     int index,
                     java.lang.Class<T> returnClass,
                     java.util.function.Function<java.lang.String,​T> parser)
        
        This is an internal helper method for retrieving an element from a JsonArray, and converting it to one of the standard Java Types.
        Type Parameters:
        T - Numeric Boxed-Type, as an instance of java.lang.Class
        Parameters:
        ja - Any instance of JsonArray
        index - A valid index into 'ja'
        returnClass - Internally specified Numeric Boxed-Type, used for Type Inference
        parser - Any function-pointer to a function that will transform / convert a java.lang.String into the specified type.

        This parameter may be null, and if it is, the standard Java parser is used.
        Returns:
        The converted number, as an instance of Generic-Parameter 'T'
        See Also:
        parseInteger(JsonArray, int), parseLong(JsonArray, int), parseShort(JsonArray, int), parseByte(JsonArray, int), parseDouble(JsonArray, int), parseFloat(JsonArray, int)
        Code:
        Exact Method Body:
         // Throws an IndexOutOfBoundsException
         final JsonValue jv = ja.get(index);
        
         switch (jv.getValueType())
         {
             case NULL: return null;
        
             case STRING:
        
                 try
                     { return parser.apply(((JsonString) jv).getString()); }
        
                 catch (ArithmeticException ae)
                     { throw new JsonArithmeticArrException(ae, ja, index, STRING, jv, returnClass);}
        
                 catch (Exception e)
                     { throw new JsonStrParseArrException (e, ja, index, jv, returnClass); }
        
             default: throw new JsonTypeArrException(ja, index, STRING, jv, returnClass);
         }
        
      • PARSE_NO_FLAGS

        🡅     🗕  🗗  🗖
        protected static <T extends java.lang.Number> T PARSE_NO_FLAGS​
                    (JsonObject jo,
                     java.lang.String propertyName,
                     boolean isOptional,
                     java.lang.Class<T> returnClass,
                     java.util.function.Function<java.lang.String,​T> parser)
        
        This is an internal helper method for retrieving a property from a JsonObject, and converting it to one of the standard Java Types.
        Type Parameters:
        T - Numeric Boxed-Type, as an instance of java.lang.Class
        Parameters:
        jo - Any instance of JsonObject
        propertyName - Any property name contained by 'jo'
        isOptional - When TRUE is passed, if 'propertyName' is not actually listed in 'jo' this method shall return Java-Null gracefully. When FALSE is passed, if 'jo' does not have the specified property, a JsonPropMissingException will throw.

        If 'jo' actually has a property named 'propertyName', then the value passed to this parameter is fully irrelevant.
        parser - Any function-pointer to a function that will transform / convert a java.lang.String into the specified type.

        This parameter may be null, and if it is, the standard Java parser is used.
        Returns:
        The converted number, as an instance of Generic-Parameter 'T'
        See Also:
        parseInteger(JsonObject, String, boolean), parseLong(JsonObject, String, boolean), parseShort(JsonObject, String, boolean), parseByte(JsonObject, String, boolean), parseDouble(JsonObject, String, boolean), parseFloat(JsonObject, String, boolean)
        Code:
        Exact Method Body:
         final JsonValue jv = jo.get(propertyName);
        
         if (jv == null)
         {
             if (isOptional)
                 return null;
             else
                 throw new JsonPropMissingException(jo, propertyName, STRING, returnClass);
         }
        
         switch (jv.getValueType())
         {
             case NULL: return null;
        
             case STRING:
        
                 try
                     { return parser.apply(((JsonString) jv).getString()); }
        
                 catch (ArithmeticException ae)
                 {
                     throw new JsonArithmeticObjException
                         (ae, jo, propertyName, STRING, jv, returnClass);
                 }
        
                 catch (Exception e)
                     { throw new JsonStrParseObjException(e, jo, propertyName, jv, returnClass); }
        
             default: throw new JsonTypeObjException(jo, propertyName, STRING, jv, returnClass);
         }