Class Array2dJsonSerializer<T>
java.lang.Object
org.dominokit.jacksonapt.JsonSerializer<T[][]>
org.dominokit.jacksonapt.ser.array.dd.Array2dJsonSerializer<T>
- Type Parameters:
T- Type of the elements inside the array
public class Array2dJsonSerializer<T> extends JsonSerializer<T[][]>
Default
JsonSerializer implementation for 2D array.- Version:
- $Id: $
- Author:
- Nicolas Morel
-
Constructor Summary
Constructors Modifier Constructor Description protectedArray2dJsonSerializer(JsonSerializer<T> serializer)Constructor for Array2dJsonSerializer. -
Method Summary
Modifier and Type Method Description voiddoSerialize(JsonWriter writer, T[][] values, JsonSerializationContext ctx, JsonSerializerParameters params)Serializes a non-null object into JSON output.protected booleanisEmpty(T[][] value)isEmpty.static <T> Array2dJsonSerializer<T>newInstance(JsonSerializer<T> serializer)newInstanceMethods inherited from class org.dominokit.jacksonapt.JsonSerializer
isAbsent, isDefault, serialize, serialize, serialize, serializeNullValueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
Array2dJsonSerializer
Constructor for Array2dJsonSerializer.
- Parameters:
serializer-JsonSerializerused to serialize the objects inside the array.
-
-
Method Details
-
newInstance
newInstance
- Type Parameters:
T- Type of the elements inside the array- Parameters:
serializer-JsonSerializerused to serialize the objects inside the array.- Returns:
- a new instance of
Array2dJsonSerializer
-
isEmpty
isEmpty.
- Overrides:
isEmptyin classJsonSerializer<T[][]>- Parameters:
value- the value- Returns:
- true if the value is empty
-
doSerialize
public void doSerialize(JsonWriter writer, T[][] values, JsonSerializationContext ctx, JsonSerializerParameters params)Serializes a non-null object into JSON output.- Specified by:
doSerializein classJsonSerializer<T[][]>- Parameters:
writer-JsonWriterused to write the serialized JSONvalues- Object to serializectx- Context for the full serialization processparams- Parameters for this serialization
-