Package org.molgenis.web.support
Class EntitySerializer
- java.lang.Object
-
- org.molgenis.web.support.EntitySerializer
-
- All Implemented Interfaces:
com.google.gson.JsonSerializer<org.molgenis.data.Entity>
public class EntitySerializer extends Object implements com.google.gson.JsonSerializer<org.molgenis.data.Entity>
Serializer for concrete Entity subclasses. This allows you to return Entities in your Controllers, without having to create DTO's with explicit fields forGsonserialization.
-
-
Constructor Summary
Constructors Constructor Description EntitySerializer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.gson.JsonElementserialize(org.molgenis.data.Entity entity, Type type, com.google.gson.JsonSerializationContext context)
-
-
-
Method Detail
-
serialize
public com.google.gson.JsonElement serialize(org.molgenis.data.Entity entity, Type type, com.google.gson.JsonSerializationContext context)- Specified by:
serializein interfacecom.google.gson.JsonSerializer<org.molgenis.data.Entity>
-
-