Package Torello.Java.JSON
Class JFlag
- java.lang.Object
-
- Torello.Java.JSON.JFlag
-
public class JFlag extends java.lang.Object
Exception-Flags that may be passed to theReadJSON
methods which accept a'FLAGS'
parameter.
FLAG PRECEDENCE:
If a user actually has multiple masks for the same error case, classReadJSON
has an internal precedence / priority used for obeying the user-provided flag-masks. The flags that handle "On Any" or "On All" are always obeyed last. If the user has provided error or exception specific flags, those always take precedence over the "Any & All" mask.
SPECIFICALLY:RETURN_NULL_ON_WRONG_JSONTYPE
takes precedence overRETURN_DEFVAL_ON_ANY_ALL
If a user has provided multiple masks for the same case, and both of those masks are error or exception flags, then a 'null' return takes precedence over a default-value return.
SPECIFICALLY:RETURN_NULL_ON_WRONG_JSONTYPE
takes precedence overRETURN_DEFVAL_ON_WRONG_JSONTYPE
ROCKET-SCIENCE NOTE:
The following code has been directly cut and pasted - from one of the internal,protected
'GET'
methods found inRJInternal
. It is the code for handling an'ArrayIndexOutOfBoundsException'
. (See below that the Flag Precedence rules are pretty straight-forward - and certainly are not rocket-science!).
if (index >= ja.size()) { if ((FLAGS & RETURN_NULL_ON_IOB) != 0) return null; if ((FLAGS & RETURN_DEFVAL_ON_IOB) != 0) return defaultValue; if ((FLAGS & RETURN_NULL_ON_ANY_ALL) != 0) return null; if ((FLAGS & RETURN_DEFVAL_ON_ANY_ALL) != 0) return defaultValue; ja.get(index); // Throw an IndexOutOfBoundsException }
The complete set of handlers for these flags may be viewed inside the exception-handler methods in classRJInternal
.
The flag-handlers for theReadArrJSON
andReadArrJSON.DimN
classes are available for viewing (but buried) inside that class. To see those flag-handlers / exception-case-handlers, simply click theHILITED
button in the Navigation Bar there (or theView Here:
link on that page).
Java Bit-Wise Logic Syntax:
As a simple reminder for how to "glue" together several flags, the following (simple) bit-wise operator allows the programmer to place several flags inside of a single integer:
Java Line of Code:
int myFlags = RETURN_DEFVAL_ON_ANY_ALL | RETURN_PARSE_ON_STR | RETURN_JAPPROX_ON_AEX;
The above flags-integer would guarantee that any / allJsonString
elements found which are intended to be represented as numbers are parsed into numbers. It would furthermore use the standard JDK "rounding process" for numbers that will not fit into their desired type.
Any other exceptions that might occur while processing a Json Element will produce whatever Default-Value has been passed to the method parameterdefaultValue
.
Hi-Lited Source-Code:- View Here: Torello/Java/JSON/JFlag.java
- Open New Browser-Tab: Torello/Java/JSON/JFlag.java
File Size: 34,083 Bytes Line Count: 724 '\n' Characters Found
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
- 0 Method(s)
- 60 Field(s), 60 declared static, 60 declared final
-
-
Field Summary
One-Size-Fits-All Flags, which may handle all exception & error cases Modifier and Type Field static int
RETURN_DEFVAL_ON_ANY_ALL
static int
RETURN_NULL_ON_ANY_ALL
static int
SKIP_ON_ANY_ALL
One-Size-Fits-All Flags, abbreviated Modifier and Type Field static int
RD_AA
static int
RN_AA
static int
S_AA
Flags which request null return on error Modifier and Type Field static int
RETURN_NULL_ON_0LEN_STR
static int
RETURN_NULL_ON_AEX
static int
RETURN_NULL_ON_IOB
static int
RETURN_NULL_ON_MISSING
static int
RETURN_NULL_ON_NULL
static int
RETURN_NULL_ON_SPEX
static int
RETURN_NULL_ON_WRONG_JSONTYPE
Flags (abbreviated) which request null return on error Modifier and Type Field static int
RN_AEX
static int
RN_IOB
static int
RN_M
static int
RN_N
static int
RN_SPEX
static int
RN_WT
static int
RN_ZLS
Flags which request default-value return on error Modifier and Type Field static int
RETURN_DEFVAL_ON_0LEN_STR
static int
RETURN_DEFVAL_ON_AEX
static int
RETURN_DEFVAL_ON_IOB
static int
RETURN_DEFVAL_ON_MISSING
static int
RETURN_DEFVAL_ON_NULL
static int
RETURN_DEFVAL_ON_SPEX
static int
RETURN_DEFVAL_ON_WRONG_JSONTYPE
Flags (abbreviated) which request default-value return on error Modifier and Type Field static int
RD_AEX
static int
RD_IOB
static int
RD_M
static int
RD_N
static int
RD_SPEX
static int
RD_WT
static int
RD_ZLS
Flags for requesting rounded / approximated value return on error Modifier and Type Field static int
RETURN_JAPPROX_ON_AEX
static int
RJA_AEX
Flags used only by class ReadArrJson
(for readingJsonArray's
)Modifier and Type Field static int
RETURN_DEFVAL_ON_STR
static int
RETURN_NULL_ON_STR
static int
RETURN_PARSE_ON_STR
static int
SKIP_ON_0LEN_STR
static int
SKIP_ON_AEX
static int
SKIP_ON_NULL
static int
SKIP_ON_SPEX
static int
SKIP_ON_STR
static int
SKIP_ON_WRONG_JSONTYPE
Flags (abbreviated) used only by class ReadArrJson
(for readingJsonArray's
)Modifier and Type Field static int
RD_S
static int
RN_S
static int
RP_S
static int
S_AEX
static int
S_N
static int
S_S
static int
S_SPEX
static int
S_WT
static int
S_ZLS
Flags used by ReadArrJSON.strArrayToStream(...)
Modifier and Type Field static int
RETURN_TOSTRING_ON_WRONGTYPE
static int
RTS_WT
Flags used only by class ReadArrJson.DimN
(for reading multi-dimensionalJsonArray's
)Modifier and Type Field static int
INSERT_NULL_ON_NON_SUBARRAY_TYPE
static int
SKIP_ON_NON_SUBARRAY_TYPE
Flags (abbreviated) used only by class ReadArrJson.DimN
Modifier and Type Field static int
IN_NSAT
static int
S_NSAT
-
-
-
Field Detail
-
RETURN_NULL_ON_ANY_ALL
public static final int RETURN_NULL_ON_ANY_ALL
This is a "Primary Flag" that indicates the reader should always return null for any exception-throw or error case that could possibly occur.
Flag Precedence:
When this flag is set, it always has the lowest precedence compared to all other flags. Specifically, if this flag, and the flagRETURN_DEFVAL_ON_AEX
were both set, and anArithmeticException
were going to be thrown, the user-provided default-value would be returned, rather than null.
If both flagRN_AA
andRD_AA
are set, 'null' will always be returned, rather than the default-value.
Abbreviation:
The flag-maskRN_AA
is an abbreviated but identical value that may be used if brevity is a higher priority than readability.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int RETURN_NULL_ON_ANY_ALL = 1;
-
RN_AA
public static final int RN_AA
Identical to flag-mask fieldRETURN_NULL_ON_ANY_ALL
- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int RN_AA = RETURN_NULL_ON_ANY_ALL;
-
RETURN_DEFVAL_ON_ANY_ALL
public static final int RETURN_DEFVAL_ON_ANY_ALL
This is a "Primary Flag" that indicates the reader should always return the user-provided default-value for any exception-throw or error case that could possibly occur.
Flag Precedence:
When this flag is set, it always has the lowest precedence compared to all other flags. Specifically, if this flag, and the flagRETURN_NULL_ON_AEX
were both set, and anArithmeticException
were going to be thrown, null would be returned, rather than the user-provided default-value.
If both flagRN_AA
andRD_AA
are set, 'null' will always be returned, rather than the default-value.
Abbreviation:
The flag-maskRN_AA
is an abbreviated but identical value that may be used if brevity is a higher priority than readability.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int RETURN_DEFVAL_ON_ANY_ALL = RN_AA << 1;
-
RD_AA
public static final int RD_AA
Identical to flag-mask fieldRETURN_DEFVAL_ON_ANY_ALL
- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int RD_AA = RETURN_DEFVAL_ON_ANY_ALL;
-
RETURN_NULL_ON_IOB
public static final int RETURN_NULL_ON_IOB
Instructs a get method to return null if anIndexOutOfBoundsException
would otherwise be thrown. This flag-mask is only useful with methods that acceptJsonArray
and'index'
parameters.
Abbreviation:
The flag-maskRN_IOB
is an abbreviated but identical value that may be used if brevity is a higher priority than readability.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int RETURN_NULL_ON_IOB = RD_AA << 1;
-
RN_IOB
public static final int RN_IOB
Identical to flag-mask fieldRETURN_NULL_ON_IOB
- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int RN_IOB = RETURN_NULL_ON_IOB;
-
RETURN_DEFVAL_ON_IOB
public static final int RETURN_DEFVAL_ON_IOB
Instructs a get method to return the user-provided'defaultValue'
if anIndexOutOfBoundsException
would otherwise be thrown. This flag-mask is only useful to methods which acceptJsonArray
and'index'
parameters.
Abbreviation:
The flag-maskRD_IOB
is an abbreviated but identical value that may be used if brevity is a higher priority than readability.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int RETURN_DEFVAL_ON_IOB = RN_IOB << 1;
-
RD_IOB
public static final int RD_IOB
Identical to flag-mask fieldRETURN_DEFVAL_ON_IOB
- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int RD_IOB = RETURN_DEFVAL_ON_IOB;
-
RETURN_NULL_ON_MISSING
public static final int RETURN_NULL_ON_MISSING
Instructs a get method to return null when a specified property isn't actually present in aJsonObject
. This flag-mask is only useful to methods that accept a'propertyName'
andJsonObject
parameter.
Abbreviation:
The flag-maskRN_M
is an abbreviated but identical value that may be used if brevity is a higher priority than readability.- See Also:
JsonPropMissingException
, Constant Field Values- Code:
- Exact Field Declaration Expression:
public static final int RETURN_NULL_ON_MISSING = RD_IOB << 1;
-
RN_M
public static final int RN_M
Identical to flag-mask fieldRETURN_NULL_ON_MISSING
- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int RN_M = RETURN_NULL_ON_MISSING;
-
RETURN_DEFVAL_ON_MISSING
public static final int RETURN_DEFVAL_ON_MISSING
Instructs a get method to return a user-provided'defaultValue'
when a specified property isn't actually present in aJsonObject
. This flag-mask is only useful to methods that accept a'propertyName'
andJsonObject
parameter.
Abbreviation:
The flag-maskRD_M
is an abbreviated but identical value that may be used if brevity is a higher priority than readability.- See Also:
JsonPropMissingException
, Constant Field Values- Code:
- Exact Field Declaration Expression:
public static final int RETURN_DEFVAL_ON_MISSING = RN_M << 1;
-
RD_M
public static final int RD_M
Identical to flag-mask fieldRETURN_DEFVAL_ON_MISSING
- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int RD_M = RETURN_DEFVAL_ON_MISSING;
-
RETURN_NULL_ON_NULL
public static final int RETURN_NULL_ON_NULL
Instructs a get method to return Java-Null whenever aJsonObject
property orJsonArray
index contains Json-Null.
Abbreviation:
The flag-maskRN_N
is an abbreviated but identical value that may be used if brevity is a higher priority than readability.- See Also:
JsonNullArrException
,JsonNullObjException
,JsonNullPrimitiveArrException
,JsonNullPrimitiveObjException
, Constant Field Values- Code:
- Exact Field Declaration Expression:
public static final int RETURN_NULL_ON_NULL = RD_M << 1;
-
RN_N
public static final int RN_N
Identical to flag-mask fieldRETURN_NULL_ON_NULL
- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int RN_N = RETURN_NULL_ON_NULL;
-
RETURN_DEFVAL_ON_NULL
public static final int RETURN_DEFVAL_ON_NULL
Instructs a get method to return a user-provided'defaultValue'
whenever aJsonObject
property orJsonArray
index contains Json-Null.
Abbreviation:
The flag-maskRD_N
is an abbreviated but identical value that may be used if brevity is a higher priority than readability.- See Also:
JsonNullArrException
,JsonNullObjException
,JsonNullPrimitiveArrException
,JsonNullPrimitiveObjException
, Constant Field Values- Code:
- Exact Field Declaration Expression:
public static final int RETURN_DEFVAL_ON_NULL = RN_N << 1;
-
RD_N
public static final int RD_N
Identical to flag-mask fieldRETURN_DEFVAL_ON_NULL
- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int RD_N = RETURN_DEFVAL_ON_NULL;
-
RETURN_NULL_ON_AEX
public static final int RETURN_NULL_ON_AEX
Instructs a get method to return null if anArithmeticException
would otherwise be thrown.
Abbreviation:
The flag-maskRN_AEX
is an abbreviated but identical value that may be used if brevity is a higher priority than readability.- See Also:
JsonArithmeticArrException
,JsonArithmeticObjException
, Constant Field Values- Code:
- Exact Field Declaration Expression:
public static final int RETURN_NULL_ON_AEX = RD_N << 1;
-
RN_AEX
public static final int RN_AEX
Identical to flag-mask fieldRETURN_NULL_ON_AEX
- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int RN_AEX = RETURN_NULL_ON_AEX;
-
RETURN_DEFVAL_ON_AEX
public static final int RETURN_DEFVAL_ON_AEX
Instructs a get method to return the user-provided'defaultValue'
if anArithmeticException
would otherwise be thrown.
Abbreviation:
The flag-maskRD_AEX
is an abbreviated but identical value that may be used if brevity is a higher priority than readability.- See Also:
JsonArithmeticArrException
,JsonArithmeticObjException
, Constant Field Values- Code:
- Exact Field Declaration Expression:
public static final int RETURN_DEFVAL_ON_AEX = RN_AEX << 1;
-
RD_AEX
public static final int RD_AEX
Identical to flag-mask fieldRETURN_DEFVAL_ON_AEX
- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int RD_AEX = RETURN_DEFVAL_ON_AEX;
-
RETURN_JAPPROX_ON_AEX
public static final int RETURN_JAPPROX_ON_AEX
Instructs a get method to use a Standard Java Alternative / Rounding Method if anArithmeticException
would otherwise be thrown.
The exact process for 'fitting' a number that is too big for a particular primitive is the implemented in classjava.math.BigDecimal
. Below are the explanations for fitting a number into anint
and afloat
.
Description copied from class:java.math.BigDecimal.intValue()
, JDK 1.8
This conversion is analogous to the narrowing primitive conversion fromdouble
toshort
as defined in section 5.1.3 of The Java™ Language Specification: any fractional part of thisBigDecimal
will be discarded, and if the resulting "BigInteger
" is too big to fit in anint
, only the low-order 32 bits are returned. Note that this conversion can lose information about the overall magnitude and precision of thisBigDecimal
value as well as return a result with the opposite sign.
Description copied from class:java.math.BigDecimal.floatValue()
, JDK 1.8
This conversion is similar to the narrowing primitive conversion fromdouble
tofloat
as defined in section 5.1.3 of The Java™ Language Specification: if thisBigDecimal
has too great a magnitude to represent as afloat
, it will be converted toFloat.NEGATIVE_INFINITY
orFloat.POSITIVE_INFINITY
as appropriate. Note that even when the return value is finite, this conversion can lose information about the precision of theBigDecimal
value.
Abbreviation:
The flag-maskRJA_AEX
is an abbreviated but identical value that may be used if brevity is a higher priority than readability.- See Also:
JsonArithmeticArrException
,JsonArithmeticObjException
, Constant Field Values- Code:
- Exact Field Declaration Expression:
public static final int RETURN_JAPPROX_ON_AEX = RD_AEX << 1;
-
RJA_AEX
public static final int RJA_AEX
Identical to flag-mask fieldRETURN_JAPPROX_ON_AEX
- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int RJA_AEX = RETURN_JAPPROX_ON_AEX;
-
RETURN_NULL_ON_WRONG_JSONTYPE
public static final int RETURN_NULL_ON_WRONG_JSONTYPE
Instructs a get method to return null in cases where aJsonObject
property orJsonArray
index does not contain the expected Json-Type
Abbreviation:
The flag-maskRN_WT
is an abbreviated but identical value that may be used if brevity is a higher priority than readability.- See Also:
JsonTypeArrException
,JsonTypeObjException
, Constant Field Values- Code:
- Exact Field Declaration Expression:
public static final int RETURN_NULL_ON_WRONG_JSONTYPE = RJA_AEX << 1;
-
RN_WT
public static final int RN_WT
Identical to flag-mask fieldRETURN_NULL_ON_WRONG_JSONTYPE
- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int RN_WT = RETURN_NULL_ON_WRONG_JSONTYPE;
-
RETURN_DEFVAL_ON_WRONG_JSONTYPE
public static final int RETURN_DEFVAL_ON_WRONG_JSONTYPE
Instructs a get method to return the user-provided'defaultValue'
in cases where aJsonObject
property orJsonArray
index does not contain the expected Json-Type
Abbreviation:
The flag-maskRD_WT
is an abbreviated but identical value that may be used if brevity is a higher priority than readability.- See Also:
JsonTypeArrException
,JsonTypeObjException
, Constant Field Values- Code:
- Exact Field Declaration Expression:
public static final int RETURN_DEFVAL_ON_WRONG_JSONTYPE = RN_WT << 1;
-
RD_WT
public static final int RD_WT
Identical to flag-mask fieldRETURN_DEFVAL_ON_WRONG_JSONTYPE
- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int RD_WT = RETURN_DEFVAL_ON_WRONG_JSONTYPE;
-
RETURN_NULL_ON_0LEN_STR
public static final int RETURN_NULL_ON_0LEN_STR
Instructs a get method to return null in cases where aJsonObject
property orJsonArray
index contains a zero-lengthJsonString
Abbreviation:
The flag-maskRN_ZLS
is an abbreviated but identical value that may be used if brevity is a higher priority than readability.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int RETURN_NULL_ON_0LEN_STR = RD_WT << 1;
-
RN_ZLS
public static final int RN_ZLS
Identical to flag-mask fieldRETURN_NULL_ON_0LEN_STR
- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int RN_ZLS = RETURN_NULL_ON_0LEN_STR;
-
RETURN_DEFVAL_ON_0LEN_STR
public static final int RETURN_DEFVAL_ON_0LEN_STR
Instructs a get method to return the user-provided'defaultValue'
in cases where aJsonObject
property orJsonArray
index contains a zero-lengthJsonString
Abbreviation:
The flag-maskRD_ZLS
is an abbreviated but identical value that may be used if brevity is a higher priority than readability.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int RETURN_DEFVAL_ON_0LEN_STR = RN_ZLS << 1;
-
RD_ZLS
public static final int RD_ZLS
Identical to flag-mask fieldRETURN_DEFVAL_ON_0LEN_STR
- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int RD_ZLS = RETURN_DEFVAL_ON_0LEN_STR;
-
RETURN_NULL_ON_SPEX
public static final int RETURN_NULL_ON_SPEX
Instructs a get method to return null in cases where the user-provided'parser'
function has thrown an exception.
SPEX: String Parse Exception
Abbreviation:
The flag-maskRN_SPEX
is an abbreviated but identical value that may be used if brevity is a higher priority than readability.- See Also:
JsonStrParseArrException
,JsonStrParseObjException
, Constant Field Values- Code:
- Exact Field Declaration Expression:
public static final int RETURN_NULL_ON_SPEX = RD_ZLS << 1;
-
RN_SPEX
public static final int RN_SPEX
Identical to flag-mask fieldRETURN_NULL_ON_SPEX
- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int RN_SPEX = RETURN_NULL_ON_SPEX;
-
RETURN_DEFVAL_ON_SPEX
public static final int RETURN_DEFVAL_ON_SPEX
Instructs a get method to return the user-provided'defaultValue'
in cases where the user-provided'parser'
function has thrown an exception.
SPEX: String Parse Exception
Abbreviation:
The flag-maskRD_SPEX
is an abbreviated but identical value that may be used if brevity is a higher priority than readability.- See Also:
JsonStrParseArrException
,JsonStrParseObjException
, Constant Field Values- Code:
- Exact Field Declaration Expression:
public static final int RETURN_DEFVAL_ON_SPEX = RN_SPEX << 1;
-
RD_SPEX
public static final int RD_SPEX
Identical to flag-mask fieldRETURN_DEFVAL_ON_SPEX
- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int RD_SPEX = RETURN_DEFVAL_ON_SPEX;
-
SKIP_ON_ANY_ALL
public static final int SKIP_ON_ANY_ALL
This is a "Primary Flag" that indicates the reader should always skip any array-entry for any exception-throw or error case that could possibly occur.
Flag Precedence:
When this flag is set, it always has the lowest precedence compared to all other flags. Specifically, if this flag, and the flagRETURN_DEFVAL_ON_AEX
were both set, and anArithmeticException
were going to be thrown, the user-provided default-value would be placed into the output, rather than being skipped.
If both flagS_AA
andRN_AA
are set, 'null' will always be placed into the output, before skipping the array-index, or using the default-value.
Abbreviation:
The flag-maskS_AA
is an abbreviated but identical value that may be used if brevity is a higher priority than readability.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int SKIP_ON_ANY_ALL = RD_SPEX << 1;
-
S_AA
public static final int S_AA
Identical to flag-mask fieldSKIP_ON_ANY_ALL
- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int S_AA = SKIP_ON_ANY_ALL;
-
SKIP_ON_NULL
public static final int SKIP_ON_NULL
Instructs an array / stream builder method to skip an array element, if-and-when aJsonArray
index contain a Json-Null.
When an array-index location is skipped during a converstion, the returned stream will simply have a size shorter than the inputJsonArray's
size, shortened by the number of skipped-indices.
Abbreviation:
The flag-maskS_N
is an abbreviated but identical value that may be used if brevity is a higher priority than readability.
For Reading Arrays Only:
This flag is ignored, completely, by all methods inReadJSON
, and is only useful inReadArrJSON
. Any flag which begins with'SKIP'
will only be applied to array-processing methods.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int SKIP_ON_NULL = S_AA << 1;
-
S_N
public static final int S_N
Identical to flag-mask fieldSKIP_ON_NULL
- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int S_N = SKIP_ON_NULL;
-
SKIP_ON_AEX
public static final int SKIP_ON_AEX
Instructs an array / stream builder method to skip an array element, if-and-when if anArithmeticException
would otherwise be thrown.
When an array-index location is skipped during a converstion, the returned stream will simply have a size shorter than the inputJsonArray's
size, shortened by the number of skipped-indices.
Abbreviation:
The flag-maskS_AEX
is an abbreviated but identical value that may be used if brevity is a higher priority than readability.
For Reading Arrays Only:
This flag is ignored, completely, by all methods inReadJSON
, and is only useful inReadArrJSON
. Any flag which begins with'SKIP'
will only be applied to array-processing methods.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int SKIP_ON_AEX = S_N << 1;
-
S_AEX
public static final int S_AEX
Identical to flag-mask fieldSKIP_ON_AEX
- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int S_AEX = SKIP_ON_AEX;
-
RETURN_PARSE_ON_STR
public static final int RETURN_PARSE_ON_STR
Instructs an array / stream builder method to parse an array element into a number, if-and-when aJsonString
is encountered.
Abbreviation:
The flag-maskRP_S
is an abbreviated but identical value that may be used if brevity is a higher priority than readability.
For Reading Arrays Only:
This flag is ignored, completely, by all methods inReadJSON
, and is only useful inReadArrJSON
.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int RETURN_PARSE_ON_STR = S_AEX << 1;
-
RP_S
public static final int RP_S
Identical to flag-mask fieldRETURN_PARSE_ON_STR
- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int RP_S = RETURN_PARSE_ON_STR;
-
RETURN_NULL_ON_STR
public static final int RETURN_NULL_ON_STR
Instructs a boxed-stream builder method to insert Java-Null into the boxed-stream whenever aJsonArray
index contains aJsonString
.
This flag is ignored if passed to a primitive-stream builder method. A primitive-stream (and its associated builder) will not accept nulls.
Abbreviation:
The flag-maskRN_S
is an abbreviated but identical value that may be used if brevity is a higher priority than readability.
For Reading Arrays Only:
This flag is ignored, completely, by all methods inReadJSON
, and is only useful inReadArrJSON
.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int RETURN_NULL_ON_STR = RP_S << 1;
-
RN_S
public static final int RN_S
Identical to flag-mask fieldRETURN_NULL_ON_STR
- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int RN_S = RETURN_NULL_ON_STR;
-
RETURN_DEFVAL_ON_STR
public static final int RETURN_DEFVAL_ON_STR
Instructs an array / stream builder method to insert the user-provided'defaultValue'
whenever aJsonString
is encountered at a particular index inside aJsonArray
.
Abbreviation:
The flag-maskRD_S
is an abbreviated but identical value that may be used if brevity is a higher priority than readability.
For Reading Arrays Only:
This flag is ignored, completely, by all methods inReadJSON
, and is only useful inReadArrJSON
.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int RETURN_DEFVAL_ON_STR = RN_S << 1;
-
RD_S
public static final int RD_S
Identical to flag-mask fieldRETURN_DEFVAL_ON_STR
- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int RD_S = RETURN_DEFVAL_ON_STR;
-
SKIP_ON_STR
public static final int SKIP_ON_STR
Instructs an array / stream builder method to skip anyJsonArray
index-locations that contain aJsonString
.
When an array-index location is skipped during a converstion, the returned stream will simply have a size shorter than the inputJsonArray's
size, shortened by the number of skipped-indices.
Abbreviation:
The flag-maskS_S
is an abbreviated but identical value that may be used if brevity is a higher priority than readability.
For Reading Arrays Only:
This flag is ignored, completely, by all methods inReadJSON
, and is only useful inReadArrJSON
. Any flag which begins with'SKIP'
will only be applied to array-processing methods.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int SKIP_ON_STR = RD_S << 1;
-
S_S
public static final int S_S
Identical to flag-mask fieldSKIP_ON_STR
- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int S_S = SKIP_ON_STR;
-
SKIP_ON_0LEN_STR
public static final int SKIP_ON_0LEN_STR
Instructs an array / stream builder method to skip anyJsonArray
index-locations that contain a Zero-LengthJsonString
.
When an array-index location is skipped during a converstion, the returned stream will simply have a size shorter than the inputJsonArray's
size, shortened by the number of skipped-indices.
Abbreviation:
The flag-maskS_ZLS
is an abbreviated but identical value that may be used if brevity is a higher priority than readability.
For Reading Arrays Only:
This flag is ignored, completely, by all methods inReadJSON
, and is only useful inReadArrJSON
. Any flag which begins with'SKIP'
will only be applied to array-processing methods.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int SKIP_ON_0LEN_STR = S_S << 1;
-
S_ZLS
public static final int S_ZLS
Identical to flag-mask fieldSKIP_ON_0LEN_STR
- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int S_ZLS = SKIP_ON_0LEN_STR;
-
SKIP_ON_SPEX
public static final int SKIP_ON_SPEX
Instructs an array / stream builder method to skip anyJsonArray
index-locations that contain aJsonString
that, when parsed, generate any parse-exceptions, such asNumberFormatException
.
When an array-index location is skipped during a converstion, the returned stream will simply have a size shorter than the inputJsonArray's
size, shortened by the number of skipped-indices.
SPEX: String Parse Exception
Abbreviation:
The flag-maskS_SPEX
is an abbreviated but identical value that may be used if brevity is a higher priority than readability.
For Reading Arrays Only:
This flag is ignored, completely, by all methods inReadJSON
, and is only useful inReadArrJSON
. Any flag which begins with'SKIP'
will only be applied to array-processing methods.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int SKIP_ON_SPEX = S_ZLS << 1;
-
S_SPEX
public static final int S_SPEX
Identical to flag-mask fieldSKIP_ON_SPEX
- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int S_SPEX = SKIP_ON_SPEX;
-
SKIP_ON_WRONG_JSONTYPE
public static final int SKIP_ON_WRONG_JSONTYPE
Instructs an array / stream builder method to skip anyJsonArray
index-locations that contain an inapplicable Json-Type - such asJsonValue.TRUE
,JsonValue.FALSE
,JsonObject
, a nestedJsonArray
etc...
When an array-index location is skipped during a converstion, the returned stream will simply have a size shorter than the inputJsonArray's
size, shortened by the number of skipped-indices.
Abbreviation:
The flag-maskS_WT
is an abbreviated but identical value that may be used if brevity is a higher priority than readability.
For Reading Arrays Only:
This flag is ignored, completely, by all methods inReadJSON
, and is only useful inReadArrJSON
. Any flag which begins with'SKIP'
will only be applied to array-processing methods.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int SKIP_ON_WRONG_JSONTYPE = S_SPEX << 1;
-
S_WT
public static final int S_WT
Identical to flag-mask fieldSKIP_ON_WRONG_JSONTYPE
- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int S_WT = SKIP_ON_WRONG_JSONTYPE;
-
RETURN_TOSTRING_ON_WRONGTYPE
public static final int RETURN_TOSTRING_ON_WRONGTYPE
Instructs theStream<String>
(array/stream) builder method to invokeJsonValue.toString()
whenever a type other thanJsonString
is found in an array position. This flag is only applicable when converting aJsonArray
into aString[]
-Array.
Abbreviation:
The flag-maskRTS_WT
is an abbreviated but identical value that may be used if brevity is a higher priority than readability.
For Specific Method Only:
This flag is ignored, completely, by all methods inReadJSON
, and is only useful in invocations of methodReadArrJSON.strArrayToStream(javax.json.JsonArray, java.lang.String, int)
.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int RETURN_TOSTRING_ON_WRONGTYPE = S_WT << 1;
-
RTS_WT
public static final int RTS_WT
Identical to flag-mask fieldRETURN_TOSTRING_ON_WRONGTYPE
- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int RTS_WT = RETURN_TOSTRING_ON_WRONGTYPE;
-
INSERT_NULL_ON_NON_SUBARRAY_TYPE
public static final int INSERT_NULL_ON_NON_SUBARRAY_TYPE
Instructs the multi-dimensional array-builder method to place a null in an array when it encounters aJsonArray
element that is not a sub-array, but rather some other non-null Json-Type This flag is only applicable when converting aJsonArray
using one of the multi-dimensional array-processors in classReadArrJSON.DimN
.
Abbreviation:
The flag-maskIN_NSAT
is an abbreviated but identical value that may be used if brevity is a higher priority than readability.
For Reading Multi-Dimensional Arrays Only:
This flag is ignored, completely, by all methods inReadJSON
and inReadArrJSON
. It is only used in processing multi-dimensional arrays (by classReadArrJSON.DimN
).- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int INSERT_NULL_ON_NON_SUBARRAY_TYPE = RTS_WT << 1;
-
IN_NSAT
public static final int IN_NSAT
Identical to flag-mask fieldINSERT_NULL_ON_NON_SUBARRAY_TYPE
- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int IN_NSAT = INSERT_NULL_ON_NON_SUBARRAY_TYPE;
-
SKIP_ON_NON_SUBARRAY_TYPE
public static final int SKIP_ON_NON_SUBARRAY_TYPE
Instructs the multi-dimensional array-builder method to skip the element when it encounters aJsonArray
element that is not a sub-array, but rather some other non-null Json-Type This flag is only applicable when converting aJsonArray
using one of the multi-dimensional array-processors in classReadArrJSON.DimN
.
Abbreviation:
The flag-maskS_NSAT
is an abbreviated but identical value that may be used if brevity is a higher priority than readability.
For Reading Multi-Dimensional Arrays Only:
This flag is ignored, completely, by all methods inReadJSON
and inReadArrJSON
. It is only used in processing multi-dimensional arrays (by classReadArrJSON.DimN
).- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int SKIP_ON_NON_SUBARRAY_TYPE = IN_NSAT << 1;
-
S_NSAT
public static final int S_NSAT
Identical to flag-mask fieldSKIP_ON_NON_SUBARRAY_TYPE
- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final int S_NSAT = SKIP_ON_NON_SUBARRAY_TYPE;
-
-