Package Torello.Java.JSON
Class WrongModeException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- Torello.Java.JSON.WrongModeException
-
- All Implemented Interfaces:
java.io.Serializable
public class WrongModeException extends java.lang.RuntimeException
If thisSettingsRec
instance was not configured to emit / output its data to aConsumer
(of any variant), then this exception will throw on invocation of this method. This method is only valid in situations where this record was constructed to ProcessJsonArray
data that is to be output to aConsumer
.
This exception will also throw if the type ofConsumer
which was used to generate thisSettingsRec
does not match the Type-Parameter of this Method-Signature.
Supported Consumer Types for JSON Array Processing. You must invoke the method that has a Consumer-Parameter which matches the original-contents that were used to build thisSettingsRec
instance. View the two types of Java-Consumer's
available, here, in the table below:CONSUMER TYPE DESCRIPTION OF PARAMETERS Consumer<T>
The method will invoke the consumer with only the array element of type T
. This is used when the output handler only needs the actual value from the JSON array, such asInteger
,String
,MyObject
, etc.IntIntTConsumer<T>
The method will invoke the consumer with three arguments: int jsonArrayIndex
– The original index of the element within the JSON array
int successCount
– The number of valid elements processed so far (excluding skips)
T element
– The parsed JSON element
This form is used when metadata such as the array index or processing count is needed during iteration, for logging, analysis, or structured output.- See Also:
- Serialized Form
Hi-Lited Source-Code:- View Here: Torello/Java/JSON/WrongModeException.java
- Open New Browser-Tab: Torello/Java/JSON/WrongModeException.java
File Size: 587 Bytes Line Count: 19 '\n' Characters Found
-
-
Field Summary
Fields Modifier and Type Field static long
serialVersionUID
-
Constructor Summary
Constructors Constructor WrongModeException()
WrongModeException(String message)
-
-
-
Field Detail
-
serialVersionUID
public static final long serialVersionUID
This fulfils the SerialVersion UID requirement for all classes that implement Java'sinterface java.io.Serializable
. Using theSerializable
Implementation offered by java is very easy, and can make saving program state when debugging a lot easier. It can also be used in place of more complicated systems like "hibernate" to store data as well.
Note that Java'sjava.lang.Exception
andjava.lang.Error
classes implement theSerializable interface
, and a warning-free build expects this field be defined here.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final long serialVersionUID = 1;
-
-
Constructor Detail
-
WrongModeException
public WrongModeException(java.lang.String message)
Constructs a new WrongModeException with the specified message.- Parameters:
message
- the detail message
-
WrongModeException
public WrongModeException()
Constructs a new WrongModeException with no detail message.
-
-