Package Torello.JSON
Class RJArrDimN
- java.lang.Object
-
- Torello.JSON.RJArrDimN
-
public class RJArrDimN extends java.lang.Object
RJArrIntoDimN 🠞RJArr- ReadJsonArray
This class is used for reading data directly from an already parsedJsonArrayinstance.
DimN- Data is sent to a Multi-Dimensional, User-Specified, Java-Array.
Parses Multi-Dimensional JSON Array's into Multi-Dimensional Java Array's.
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.
Read Multi-Dimensional JsonArray's into Multi-Dimensional Java Arrays
This class offers a straightforward way to convert Multi-DimensionalJsonArrayinstances into Multi-Dimensional Java-Arrays. It is only required that the actual final class of the desired output array be provided as input to the method that shall perform this processing.
The class allows a user to extract any Java array-type (including Primitive-Arrays) having any number of dimensions for the array, from aJsonArray.
JSON-Array Types:JsonArray'sare allowed quite a bit of leeway in how their data is arranged. First, aJsonArrayisn't required to contain a single type of data object. An array may have aJsonStringfollowed by threeJsonNumber's, and end with anotherJsonArray. Java does not allow such array types.
In Java, for instance, a two-dimensionalString-Array may only have actualString-references in the second-dimensional arrays! The first-dimension of the array must containString[]array pointers, or nulls. AJsonArraycould contain severalString'sfollwed by another, nested,JsonArrayofString's. Care must be taken in how to handle such parses so that the data is parsed properly, and that the output would adhere to standard Java Array-Type "rules" (for lack of a better term).
Here is an example that is perfectly legal in JSON, but simply may not be parsed into any correlated-array in Java. Attempting to use this multi-dimensional array parser on the followingJsonArraywill cause an exception throw.
Java Script Object Notation (JSON):
{ "MyValidJsonArray": [ "Hello", "How are You?", ["This", "is", "not", "allowed", "in Java"]] }
The above example will cause an exception throw if attempting to convert it into a Two-DimensionalString[]-Array. In Java, the first dimension of the array may only contain sub-arrays of typeString[]. It is the Second-Dimension that may actually haveString-References.
Parsing the aboveJsonArraywould require the programmer to first decide how he wishes to represent the array, and then essentially write a manual conversion algorithm to generate some version of what is above. In leiu of "guessing" what the programmer actually wants done, this type ofJsonArraysimply cannot be type-transformer class.
IMPORTANT:
In each of the methods in this class, the programmer must provide the return-type that should be returned by that method. Thejava.lang.Classprovided must obey the following specifications:- The return-type must be an array-type class
- The root component-class of the array must be consistent with the method-name
- The dimensionality of the array must be equal to the variable, field or parameter to which the method result is being assigned.
For instance, to parse a three-dimensionalString-Array, one would use the following line of code. Note that the appropriate class is simply obtained by appending'.class'to the end of theString-array. Also note that the variable being assigned (myStrArray) has an identical-type to the type-class passed to this method (String[][]).
Java Line of Code:
String[][] myStrArray = RJArrDimN.strArr(someJsonArray, null, 0, String[][].class);
Method Parameters
Parameter Explanation jaThis may be any parsed JsonArraywhose contents are consistent with the Expected Output-Array Base-Type returned from whichever method is being invoked.'c'.defaultValueWhen an appropriate JFlag-Value is included in the mask, this Default-Value will be passed to the User-Provided Consumer in whichever Error-Circumstance has occured (as per the Flag-Value Name).
This Default-Value may be requested throughJFlag-Values such as:RD_AEX,RD_IOBandRD_M(among others). The'RD'in these Flag's Names is an abbreviation for "Return Default-Value".
The Complete List of Flags which request that this Default-Value Parameter be employed under various Error-Circumstances may be viewed in the following link. The name of each of these flags attempts identify the type of Error-Situation to which it may be applied.
Default-Value FlagsFLAGSA Bit-Wise Flag-Mask that provides a means for configuring the Array-Processing Logic to properly handle several types of Error-Cases & potentatial, unexpected, array contents.
A Flag-Mask of'0'requests that any Error-Situations which occur, should they crop up while processing the array, be handled by standard means - meaning by throwing one of the germaine Exception-Class.optionalUserParserThis parameter can only serve a purpose when it is used in conjunction with a JFlag-Vaule which explicity requests that JavaString-Values be handled by a parser (rather than causing an exception to throw).
The two flags which may be employed to signal this Handler-Behavior are:RETURN_PARSE_ON_STRandRP_S(the latter being merely the abbreviated variant of the former).
If neither of these flags have been AND'ed into the Flag-Mask parameter ("FLAGS"), then any function which is passed to this parameter ("optionalUserParser") is wholly ignored - simply because using aString-Parser is not a "Default Behavior of this class' Array-Processing Logic.retArrClassThe requested / expected Return-Array Type.
To extract or retrieve a 2-Dimensional Integer-Array, simply passint[][].class
To request a 3-Dimensional String-Array, simply passString[][][].class
Hi-Lited Source-Code:This File's Source Code:
- View Here: Torello/JSON/RJArrDimN.java
- Open New Browser-Tab: Torello/JSON/RJArrDimN.java
File Size: 21,008 Bytes Line Count: 545 '\n' Characters Found
Internal Use Only: Settings-Record Helper:
- View Here: BASIC_TYPES.java
- Open New Browser-Tab: BASIC_TYPES.java
File Size: 28,899 Bytes Line Count: 621 '\n' Characters Found
Internal Use Only: Settings-Record Helper:
- View Here: GENERATE_1DARRAY.java
- Open New Browser-Tab: GENERATE_1DARRAY.java
File Size: 7,991 Bytes Line Count: 246 '\n' Characters Found
Internal Use Only: Settings-Record Helper:
- View Here: SETTINGS_REC_BUILDER.java
- Open New Browser-Tab: SETTINGS_REC_BUILDER.java
File Size: 9,477 Bytes Line Count: 218 '\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
- 16 Method(s), 16 declared static
- 0 Field(s)
-
-
Method Summary
Read a JsonArrayinto a Multi-DimensionalString-ArrayModifier and Type Method static <T> TstrArr(JsonArray ja, String defaultValue, int FLAGS, Class<T> retArrClass)Read a JsonArrayinto a Multi-Dimensional Primitive-ArrayModifier and Type Method static <T> TbooleanArr(JsonArray ja, boolean defaultValue, int FLAGS, Predicate<String> optionalUserParser, Class<T> retArrClass)static <T> TbyteArr(JsonArray ja, byte defaultValue, int FLAGS, ToByteFunction<String> optionalUserParser, Class<T> retArrClass)static <T> TdoubleArr(JsonArray ja, double defaultValue, int FLAGS, ToDoubleFunction<String> optionalUserParser, Class<T> retArrClass)static <T> TfloatArr(JsonArray ja, float defaultValue, int FLAGS, ToFloatFunction<String> optionalUserParser, Class<T> retArrClass)static <T> TintArr(JsonArray ja, int defaultValue, int FLAGS, ToIntFunction<String> optionalUserParser, Class<T> retArrClass)static <T> TlongArr(JsonArray ja, long defaultValue, int FLAGS, ToLongFunction<String> optionalUserParser, Class<T> retArrClass)static <T> TshortArr(JsonArray ja, short defaultValue, int FLAGS, ToShortFunction<String> optionalUserParser, Class<T> retArrClass)Read a JsonArrayinto a Multi-Dimensional Boxed-Primitive ArrayModifier and Type Method static <T> TarrBOOLEAN(JsonArray ja, boolean defaultValue, int FLAGS, Function<String,Boolean> optionalUserParser, Class<T> retArrClass)static <T> TarrBYTE(JsonArray ja, byte defaultValue, int FLAGS, Function<String,Byte> optionalUserParser, Class<T> retArrClass)static <T> TarrDOUBLE(JsonArray ja, double defaultValue, int FLAGS, Function<String,Double> optionalUserParser, Class<T> retArrClass)static <T> TarrFLOAT(JsonArray ja, float defaultValue, int FLAGS, Function<String,Float> optionalUserParser, Class<T> retArrClass)static <T> TarrINTEGER(JsonArray ja, int defaultValue, int FLAGS, Function<String,Integer> optionalUserParser, Class<T> retArrClass)static <T> TarrLONG(JsonArray ja, long defaultValue, int FLAGS, Function<String,Long> optionalUserParser, Class<T> retArrClass)static <T> TarrNumber(JsonArray ja, Number defaultValue, int FLAGS, Function<String,Number> optionalUserParser, Class<T> retArrClass)static <T> TarrSHORT(JsonArray ja, short defaultValue, int FLAGS, Function<String,Short> optionalUserParser, Class<T> retArrClass)
-
-
-
Method Detail
-
intArr
public static <T> T intArr (JsonArray ja, int defaultValue, int FLAGS, java.util.function.ToIntFunction<java.lang.String> optionalUserParser, java.lang.Class<T> retArrClass)
Multi-Dimensional Array of Primitive-IntegersInvokes: Method ProcessMultiDimJsonArray.jsonArrayToJava(JsonArray, SettingsRec, Class)Passes: An intConfigurations / SettingsRecRemoves: Any JFlagmasks which might insert null-entries in the return-streamSee: Class JFlagfor information about parameter'FLAGS'See: Flag JFlag.NOT_ALLOWED_RET_NULL_MASKSfor a list of all disallowed & filtered flags.Note: The 'Type' of Parameter retArrClassmust be a multi-dimensinalint-Array Type.(Notice the "return-type" parameter which is passed in the example below)
Java Line of Code:
int[][] arr = RJArrDimN.intArr(jsonArray, -1, 0, null, int[][].class);
- Code:
- Exact Method Body:
return ProcessMultiDimJsonArray.jsonArrayToJava( ja, new SETTINGS_REC_BUILDER<Integer, IntStream>( defaultValue, FLAGS & NOT_ALLOWED_RET_NULL_MASKS, (optionalUserParser == null) ? null : optionalUserParser::applyAsInt, BASIC_TYPES.PRIMITIVE_INTEGER() ) .dimNArrayIntPrim(), retArrClass );
-
longArr
public static <T> T longArr (JsonArray ja, long defaultValue, int FLAGS, java.util.function.ToLongFunction<java.lang.String> optionalUserParser, java.lang.Class<T> retArrClass)
Multi-Dimensional Array of Primitive Long-IntegersInvokes: Method ProcessMultiDimJsonArray.jsonArrayToJava(JsonArray, SettingsRec, Class)Passes: A longConfigurations / SettingsRecRemoves: Any JFlagmasks which might insert null-entries in the return-streamSee: Class JFlagfor information about parameter'FLAGS'See: Flag JFlag.NOT_ALLOWED_RET_NULL_MASKSfor a list of all disallowed & filtered flags.Note: The 'Type' of Parameter retArrClassmust be a multi-dimensinallong-Array Type.(Notice the "return-type" parameter which is passed in the example below)
Java Line of Code:
long[][] arr = RJArrDimN.longArr(jsonArray, -1, 0, null, long[][].class);
- Code:
- Exact Method Body:
return ProcessMultiDimJsonArray.jsonArrayToJava( ja, new SETTINGS_REC_BUILDER<Long, LongStream>( defaultValue, FLAGS & NOT_ALLOWED_RET_NULL_MASKS, (optionalUserParser == null) ? null : optionalUserParser::applyAsLong, BASIC_TYPES.PRIMITIVE_LONG() ) .dimNArrayLongPrim(), retArrClass );
-
doubleArr
public static <T> T doubleArr (JsonArray ja, double defaultValue, int FLAGS, java.util.function.ToDoubleFunction<java.lang.String> optionalUserParser, java.lang.Class<T> retArrClass)
Multi-Dimensional Array of Primitive-DoublesInvokes: Method ProcessMultiDimJsonArray.jsonArrayToJava(JsonArray, SettingsRec, Class)Passes: A doubleConfigurations / SettingsRecRemoves: Any JFlagmasks which might insert null-entries in the return-streamSee: Class JFlagfor information about parameter'FLAGS'See: Flag JFlag.NOT_ALLOWED_RET_NULL_MASKSfor a list of all disallowed & filtered flags.Note: The 'Type' of Parameter retArrClassmust be a multi-dimensinaldouble-Array Type.(Notice the "return-type" parameter which is passed in the example below)
Java Line of Code:
double[][] arr = RJArrDimN.doubleArr(jsonArray, -1.0, 0, null, double[][].class);
- Code:
- Exact Method Body:
return ProcessMultiDimJsonArray.jsonArrayToJava( ja, new SETTINGS_REC_BUILDER<Double, DoubleStream>( defaultValue, FLAGS & NOT_ALLOWED_RET_NULL_MASKS, (optionalUserParser == null) ? null : optionalUserParser::applyAsDouble, BASIC_TYPES.PRIMITIVE_DOUBLE() ) .dimNArrayDoublePrim(), retArrClass );
-
shortArr
public static <T> T shortArr (JsonArray ja, short defaultValue, int FLAGS, ToShortFunction<java.lang.String> optionalUserParser, java.lang.Class<T> retArrClass)
Multi-Dimensional Array of Primitive Short-IntegersInvokes: Method ProcessMultiDimJsonArray.jsonArrayToJava(JsonArray, SettingsRec, Class)Passes: A shortConfigurations / SettingsRecRemoves: Any JFlagmasks which might insert null-entries in the return-streamSee: Class JFlagfor information about parameter'FLAGS'See: Flag JFlag.NOT_ALLOWED_RET_NULL_MASKSfor a list of all disallowed & filtered flags.Note: The 'Type' of Parameter retArrClassmust be a multi-dimensinalshort-Array Type.(Notice the "return-type" parameter which is passed in the example below)
Java Line of Code:
short[][] arr = RJArrDimN.shortArr(jsonArray, -1, 0, null, short[][].class);
- Code:
- Exact Method Body:
return ProcessMultiDimJsonArray.jsonArrayToJava( ja, new SETTINGS_REC_BUILDER<Short, Stream<Short>>( defaultValue, FLAGS & NOT_ALLOWED_RET_NULL_MASKS, (optionalUserParser == null) ? null : optionalUserParser::applyAsShort, BASIC_TYPES.PRIMITIVE_SHORT() ) .dimNArray(), retArrClass );
-
byteArr
public static <T> T byteArr (JsonArray ja, byte defaultValue, int FLAGS, ToByteFunction<java.lang.String> optionalUserParser, java.lang.Class<T> retArrClass)
Multi-Dimensional Array of Primitive-BytesInvokes: Method ProcessMultiDimJsonArray.jsonArrayToJava(JsonArray, SettingsRec, Class)Passes: A byteConfigurations / SettingsRecRemoves: Any JFlagmasks which might insert null-entries in the return-streamSee: Class JFlagfor information about parameter'FLAGS'See: Flag JFlag.NOT_ALLOWED_RET_NULL_MASKSfor a list of all disallowed & filtered flags.Note: The 'Type' of Parameter retArrClassmust be a multi-dimensinalbyte-Array Type.(Notice the "return-type" parameter which is passed in the example below)
Java Line of Code:
byte[][] arr = RJArrDimN.byteArr(jsonArray, -1, 0, null, byte[][].class);
- Code:
- Exact Method Body:
return ProcessMultiDimJsonArray.jsonArrayToJava( ja, new SETTINGS_REC_BUILDER<Byte, Stream<Byte>>( defaultValue, FLAGS & NOT_ALLOWED_RET_NULL_MASKS, (optionalUserParser == null) ? null : optionalUserParser::applyAsByte, BASIC_TYPES.PRIMITIVE_BYTE() ) .dimNArray(), retArrClass );
-
floatArr
public static <T> T floatArr (JsonArray ja, float defaultValue, int FLAGS, ToFloatFunction<java.lang.String> optionalUserParser, java.lang.Class<T> retArrClass)
Multi-Dimensional Array of Primitive-FloatsInvokes: Method ProcessMultiDimJsonArray.jsonArrayToJava(JsonArray, SettingsRec, Class)Passes: A floatConfigurations / SettingsRecRemoves: Any JFlagmasks which might insert null-entries in the return-streamSee: Class JFlagfor information about parameter'FLAGS'See: Flag JFlag.NOT_ALLOWED_RET_NULL_MASKSfor a list of all disallowed & filtered flags.Note: The 'Type' of Parameter retArrClassmust be a multi-dimensinalfloat-Array Type.(Notice the "return-type" parameter which is passed in the example below)
Java Line of Code:
float[][] arr = RJArrDimN.floatArr(jsonArray, -1.0f, 0, null, float[][].class);
- Code:
- Exact Method Body:
return ProcessMultiDimJsonArray.jsonArrayToJava( ja, new SETTINGS_REC_BUILDER<Float, Stream<Float>>( defaultValue, FLAGS & NOT_ALLOWED_RET_NULL_MASKS, (optionalUserParser == null) ? null : optionalUserParser::applyAsFloat, BASIC_TYPES.PRIMITIVE_FLOAT() ) .dimNArray(), retArrClass );
-
booleanArr
public static <T> T booleanArr (JsonArray ja, boolean defaultValue, int FLAGS, java.util.function.Predicate<java.lang.String> optionalUserParser, java.lang.Class<T> retArrClass)
Multi-Dimensional Array of Primitive-BooleansInvokes: Method ProcessMultiDimJsonArray.jsonArrayToJava(JsonArray, SettingsRec, Class)Passes: A booleanConfigurations / SettingsRecRemoves: Any JFlagmasks which might insert null-entries in the return-streamSee: Class JFlagfor information about parameter'FLAGS'See: Flag JFlag.NOT_ALLOWED_RET_NULL_MASKSfor a list of all disallowed & filtered flags.Note: The 'Type' of Parameter retArrClassmust be a multi-dimensinalboolean-Array Type.(Notice the "return-type" parameter which is passed in the example below)
Java Line of Code:
boolean[][] arr = RJArrDimN.booleanArr(jsonArray, false, 0, null, boolean[][].class);
- Code:
- Exact Method Body:
return ProcessMultiDimJsonArray.jsonArrayToJava( ja, new SETTINGS_REC_BUILDER<Boolean, Stream<Boolean>>( defaultValue, FLAGS & NOT_ALLOWED_RET_NULL_MASKS, (optionalUserParser == null) ? null : optionalUserParser::test, BASIC_TYPES.PRIMITIVE_BOOLEAN() ) .dimNArray(), retArrClass );
-
arrINTEGER
public static <T> T arrINTEGER (JsonArray ja, int defaultValue, int FLAGS, java.util.function.Function<java.lang.String,java.lang.Integer> optionalUserParser, java.lang.Class<T> retArrClass)
Multi-Dimensional Array of Boxed-IntegersInvokes: Method ProcessMultiDimJsonArray.jsonArrayToJava(JsonArray, SettingsRec, Class)Passes: An IntegerConfigurations / SettingsRecSee: Class JFlagfor information about parameter'FLAGS'Note: The 'Type' of Parameter retArrClassmust be a multi-dimensinalInteger-Array Type.(Notice the "return-type" parameter which is passed in the example below)
Java Line of Code:
Integer[][] arr = RJArrDimN.arrINTEGER(jsonArray, -1, 0, null, Integer[][].class);
- Code:
- Exact Method Body:
return ProcessMultiDimJsonArray.jsonArrayToJava( ja, new SETTINGS_REC_BUILDER<Integer, Stream<Integer>>( defaultValue, FLAGS, optionalUserParser, BASIC_TYPES.BOXED_INTEGER() ) .dimNArray(), retArrClass );
-
arrLONG
public static <T> T arrLONG (JsonArray ja, long defaultValue, int FLAGS, java.util.function.Function<java.lang.String,java.lang.Long> optionalUserParser, java.lang.Class<T> retArrClass)
Multi-Dimensional Array of Boxed Long-IntegersInvokes: Method ProcessMultiDimJsonArray.jsonArrayToJava(JsonArray, SettingsRec, Class)Passes: A LongConfigurations / SettingsRecSee: Class JFlagfor information about parameter'FLAGS'Note: The 'Type' of Parameter retArrClassmust be a multi-dimensinalLong-Array Type.(Notice the "return-type" parameter which is passed in the example below)
Java Line of Code:
Long[][] arr = RJArrDimN.arrLONG(jsonArray, -1, 0, null, Long[][].class);
- Code:
- Exact Method Body:
return ProcessMultiDimJsonArray.jsonArrayToJava( ja, new SETTINGS_REC_BUILDER<Long, Stream<Long>>( defaultValue, FLAGS, optionalUserParser, BASIC_TYPES.BOXED_LONG() ) .dimNArray(), retArrClass );
-
arrDOUBLE
public static <T> T arrDOUBLE (JsonArray ja, double defaultValue, int FLAGS, java.util.function.Function<java.lang.String,java.lang.Double> optionalUserParser, java.lang.Class<T> retArrClass)
Multi-Dimensional Array of Boxed-DoublesInvokes: Method ProcessMultiDimJsonArray.jsonArrayToJava(JsonArray, SettingsRec, Class)Passes: A DoubleConfigurations / SettingsRecSee: Class JFlagfor information about parameter'FLAGS'Note: The 'Type' of Parameter retArrClassmust be a multi-dimensinalDouble-Array Type.(Notice the "return-type" parameter which is passed in the example below)
Java Line of Code:
Double[][] arr = RJArrDimN.arrDOUBLE(jsonArray, -1.0, 0, null, Double[][].class);
- Code:
- Exact Method Body:
return ProcessMultiDimJsonArray.jsonArrayToJava( ja, new SETTINGS_REC_BUILDER<Double, Stream<Double>>( defaultValue, FLAGS, optionalUserParser, BASIC_TYPES.BOXED_DOUBLE() ) .dimNArray(), retArrClass );
-
arrSHORT
public static <T> T arrSHORT (JsonArray ja, short defaultValue, int FLAGS, java.util.function.Function<java.lang.String,java.lang.Short> optionalUserParser, java.lang.Class<T> retArrClass)
Multi-Dimensional Array of Boxed Short-IntegersInvokes: Method ProcessMultiDimJsonArray.jsonArrayToJava(JsonArray, SettingsRec, Class)Passes: A ShortConfigurations / SettingsRecSee: Class JFlagfor information about parameter'FLAGS'Note: The 'Type' of Parameter retArrClassmust be a multi-dimensinalShort-Array Type.(Notice the "return-type" parameter which is passed in the example below)
Java Line of Code:
Short[][] arr = RJArrDimN.arrSHORT(jsonArray, -1, 0, null, Short[][].class);
- Code:
- Exact Method Body:
return ProcessMultiDimJsonArray.jsonArrayToJava( ja, new SETTINGS_REC_BUILDER<Short, Stream<Short>>( defaultValue, FLAGS, optionalUserParser, BASIC_TYPES.BOXED_SHORT() ) .dimNArray(), retArrClass );
-
arrBYTE
public static <T> T arrBYTE (JsonArray ja, byte defaultValue, int FLAGS, java.util.function.Function<java.lang.String,java.lang.Byte> optionalUserParser, java.lang.Class<T> retArrClass)
Multi-Dimensional Array of Boxed-BytesInvokes: Method ProcessMultiDimJsonArray.jsonArrayToJava(JsonArray, SettingsRec, Class)Passes: A ByteConfigurations / SettingsRecSee: Class JFlagfor information about parameter'FLAGS'Note: The 'Type' of Parameter retArrClassmust be a multi-dimensinalByte-Array Type.(Notice the "return-type" parameter which is passed in the example below)
Java Line of Code:
Byte[][] arr = RJArrDimN.arrBYTE(jsonArray, -1, 0, null, Byte[][].class);
- Code:
- Exact Method Body:
return ProcessMultiDimJsonArray.jsonArrayToJava( ja, new SETTINGS_REC_BUILDER<Byte, Stream<Byte>>( defaultValue, FLAGS, optionalUserParser, BASIC_TYPES.BOXED_BYTE() ) .dimNArray(), retArrClass );
-
arrFLOAT
public static <T> T arrFLOAT (JsonArray ja, float defaultValue, int FLAGS, java.util.function.Function<java.lang.String,java.lang.Float> optionalUserParser, java.lang.Class<T> retArrClass)
Multi-Dimensional Array of Boxed-FloatsInvokes: Method ProcessMultiDimJsonArray.jsonArrayToJava(JsonArray, SettingsRec, Class)Passes: A FloatConfigurations / SettingsRecSee: Class JFlagfor information about parameter'FLAGS'Note: The 'Type' of Parameter retArrClassmust be a multi-dimensinalFloat-Array Type.(Notice the "return-type" parameter which is passed in the example below)
Java Line of Code:
Float[][] arr = RJArrDimN.arrFLOAT(jsonArray, -1.0f, 0, null, Float[][].class);
- Code:
- Exact Method Body:
return ProcessMultiDimJsonArray.jsonArrayToJava( ja, new SETTINGS_REC_BUILDER<Float, Stream<Float>>( defaultValue, FLAGS, optionalUserParser, BASIC_TYPES.BOXED_FLOAT() ) .dimNArray(), retArrClass );
-
arrBOOLEAN
public static <T> T arrBOOLEAN (JsonArray ja, boolean defaultValue, int FLAGS, java.util.function.Function<java.lang.String,java.lang.Boolean> optionalUserParser, java.lang.Class<T> retArrClass)
Multi-Dimensional Array of Boxed-BooleansInvokes: Method ProcessMultiDimJsonArray.jsonArrayToJava(JsonArray, SettingsRec, Class)Passes: A BooleanConfigurations / SettingsRecSee: Class JFlagfor information about parameter'FLAGS'Note: The 'Type' of Parameter retArrClassmust be a multi-dimensinalBoolean-Array Type.(Notice the "return-type" parameter which is passed in the example below)
Java Line of Code:
Boolean[][] arr = RJArrDimN.arrBOOLEAN(jsonArray, false, 0, null, Boolean[][].class);
- Code:
- Exact Method Body:
return ProcessMultiDimJsonArray.jsonArrayToJava( ja, new SETTINGS_REC_BUILDER<Boolean, Stream<Boolean>>( defaultValue, FLAGS, optionalUserParser, BASIC_TYPES.BOXED_BOOLEAN() ) .dimNArray(), retArrClass );
-
arrNumber
public static <T> T arrNumber (JsonArray ja, java.lang.Number defaultValue, int FLAGS, java.util.function.Function<java.lang.String,java.lang.Number> optionalUserParser, java.lang.Class<T> retArrClass)
Multi-Dimensional Array of Best-Fit Boxed-NumbersInvokes: Method ProcessMultiDimJsonArray.jsonArrayToJava(JsonArray, SettingsRec, Class)Passes: A NumberConfigurations / SettingsRecSee: Class JFlagfor information about parameter'FLAGS'Note: The 'Type' of Parameter retArrClassmust be a multi-dimensinalNumber-Array Type.(Notice the "return-type" parameter which is passed in the example below)
Java Line of Code:
Number[][] arr = RJArrDimN.arrNumber(jsonArray, 0, 0, null, Number[][].class);
- Code:
- Exact Method Body:
return ProcessMultiDimJsonArray.jsonArrayToJava( ja, new SETTINGS_REC_BUILDER<Number, Stream<Number>>( defaultValue, FLAGS, optionalUserParser, BASIC_TYPES.NUMBER_REC() ) .dimNArray(), retArrClass );
-
strArr
public static <T> T strArr(JsonArray ja, java.lang.String defaultValue, int FLAGS, java.lang.Class<T> retArrClass)
Multi-Dimensional Array of StringsInvokes: ProcessMultiDimJsonArray.jsonArrayToJava(JsonArray, SettingsRec, Class)Passes: StringConfigurations / SettingsRecSee: Class JFlagfor more information about parameter'FLAGS'.Note: retArrClassmust be a multi-dimensinalString-array.(See last "return-type" parameter in example below)
Java Line of Code:
String[][] arr = ReadArrJSON.DimN.strArr(jsonArray, null, 0, String[][].class);
- Code:
- Exact Method Body:
return ProcessMultiDimJsonArray.jsonArrayToJava( ja, new SETTINGS_REC_BUILDER<String, Stream<String>>( defaultValue, FLAGS, null, // no optional user parser, input is supposed to be a string BASIC_TYPES.STRING_REC() ) .dimNArray(), retArrClass );
-
-