- 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 ofMarshalling
for 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)
void
writeObject(StructuredWriter writer, List<T> list)
-
-
-
Constructor Detail
-
ListMarshalling
public ListMarshalling(Marshalling<T> itemMarshalling)
The constructor.- Parameters:
itemMarshalling
- theMarshalling
for the items in theList
.
-
-
Method Detail
-
writeObject
public void writeObject(StructuredWriter writer, List<T> list)
- Specified by:
writeObject
in interfaceMarshaller<T>
- Parameters:
writer
- theStructuredWriter
where to write the data of the givenobject
to. Create via e.g.JsonFormat.get().writer(writer)
orXmlFormat.get().writer(writer)
.list
- the object to serialize or marshall. If this is an instance ofMarshallableObject
then this has to be the called instance itself.
-
readObject
public List<T> readObject(StructuredReader reader)
- Specified by:
readObject
in interfaceUnmarshaller<T>
- Parameters:
reader
- theStructuredReader
where to read the data from.- Returns:
- the unmarhsalled or de-serialized object. If this is an instance of
UnmarshallableObject
then the called instance is modified by filling in the unmarshalled data and will return itself.
-
-