T - Type of the elements inside the Iterablepublic class IterableJsonSerializer<I extends Iterable<T>,T> extends JsonSerializer<I>
JsonSerializer implementation for Iterable.| Modifier and Type | Field and Description |
|---|---|
protected JsonSerializer<T> |
serializer |
| Modifier | Constructor and Description |
|---|---|
protected |
IterableJsonSerializer(JsonSerializer<T> serializer) |
| Modifier and Type | Method and Description |
|---|---|
void |
doSerialize(JsonWriter writer,
I values,
JsonSerializationContext ctx)
Serializes a non-null object into JSON output.
|
static <I extends Iterable<T>,T> |
newInstance(JsonSerializer<T> serializer) |
serializeprotected final JsonSerializer<T> serializer
protected IterableJsonSerializer(JsonSerializer<T> serializer)
serializer - JsonSerializer used to serialize the objects inside the Iterable.public static <I extends Iterable<T>,T> IterableJsonSerializer<I,T> newInstance(JsonSerializer<T> serializer)
T - Type of the elements inside the Iterableserializer - JsonSerializer used to serialize the objects inside the Iterable.IterableJsonSerializerpublic void doSerialize(JsonWriter writer, @Nonnull I values, JsonSerializationContext ctx) throws IOException
JsonSerializerdoSerialize in class JsonSerializer<I extends Iterable<T>>writer - JsonWriter used to write the serialized JSONvalues - Object to serializectx - Context for the full serialization processIOException - if an error occurs while writing the outputCopyright © 2013. All Rights Reserved.