- java.lang.Object
-
- io.github.mmm.marshall.standard.ListMarshalling<T>
-
- Type Parameters:
T- type of the datatype.
- All Implemented Interfaces:
Marshaller<List<T>>,Marshalling<List<T>>,Unmarshaller<List<T>>
public class ListMarshalling<T> extends Object implements Marshalling<List<T>>
Implementation ofMarshallingfor simple standard datatypes as specified byio.github.mmm.marshall.- Since:
- 1.0.0
- See Also:
StructuredReader.readValue(Class),StructuredWriter.writeValue(Object)
-
-
Constructor Summary
Constructors Constructor Description ListMarshalling(Marshalling<T> itemMarshalling)The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<T>readObject(StructuredReader reader)voidwriteObject(StructuredWriter writer, List<T> list)
-
-
-
Constructor Detail
-
ListMarshalling
public ListMarshalling(Marshalling<T> itemMarshalling)
The constructor.- Parameters:
itemMarshalling- theMarshallingfor the items in theList.
-
-
Method Detail
-
writeObject
public void writeObject(StructuredWriter writer, List<T> list)
- Specified by:
writeObjectin interfaceMarshaller<T>- Parameters:
writer- theStructuredWriterwhere to write the data of the givenobjectto. Create via e.g.JsonFormat.get().writer(writer)orXmlFormat.get().writer(writer).list- the object to serialize or marshall. If this is an instance ofMarshallableObjectthen this has to be the called instance itself.
-
readObject
public List<T> readObject(StructuredReader reader)
- Specified by:
readObjectin interfaceUnmarshaller<T>- Parameters:
reader- theStructuredReaderwhere to read the data from.- Returns:
- the unmarhsalled or de-serialized object. If this is an instance of
UnmarshallableObjectthen the called instance is modified by filling in the unmarshalled data and will return itself.
-
-