Package edu.sc.seis.TauP.gson
Class DistanceAngleRaySerializier
- java.lang.Object
-
- edu.sc.seis.TauP.gson.DistanceAngleRaySerializier
-
- All Implemented Interfaces:
com.google.gson.JsonSerializer<DistanceAngleRay>
public class DistanceAngleRaySerializier extends java.lang.Object implements com.google.gson.JsonSerializer<DistanceAngleRay>
-
-
Constructor Summary
Constructors Constructor Description DistanceAngleRaySerializier()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.gson.JsonElement
serialize(DistanceAngleRay src, java.lang.reflect.Type typeOfSrc, com.google.gson.JsonSerializationContext context)
Gson invokes this call-back method during serialization when it encounters a field of the specified type.
-
-
-
Method Detail
-
serialize
public com.google.gson.JsonElement serialize(DistanceAngleRay src, java.lang.reflect.Type typeOfSrc, com.google.gson.JsonSerializationContext context)
Gson invokes this call-back method during serialization when it encounters a field of the specified type.In the implementation of this call-back method, you should consider invoking
JsonSerializationContext.serialize(Object, Type )
method to create JsonElements for any non-trivial field of thesrc
object. However, you should never invoke it on thesrc
object itself since that will cause an infinite loop (Gson will call your call-back method again).- Specified by:
serialize
in interfacecom.google.gson.JsonSerializer<DistanceAngleRay>
- Parameters:
src
- the object that needs to be converted to Json.typeOfSrc
- the actual type (fully genericized version) of the source object.context
-- Returns:
- a JsonElement corresponding to the specified object.
-
-