Class ArrayJsonSerializer<T>
java.lang.Object
org.dominokit.jacksonapt.JsonSerializer<T[]>
org.dominokit.jacksonapt.ser.array.ArrayJsonSerializer<T>
- Type Parameters:
T- Type of the elements inside the array
public class ArrayJsonSerializer<T> extends JsonSerializer<T[]>
Default
JsonSerializer implementation for array.- Version:
- $Id: $
- Author:
- Nicolas Morel
-
Constructor Summary
Constructors Modifier Constructor Description protectedArrayJsonSerializer(JsonSerializer<T> serializer)Constructor for ArrayJsonSerializer. -
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> ArrayJsonSerializer<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
-
ArrayJsonSerializer
Constructor for ArrayJsonSerializer.
- 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
ArrayJsonSerializer
-
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
-