Package org.reflections.serializers
Class JsonSerializer
- java.lang.Object
-
- org.reflections.serializers.JsonSerializer
-
- All Implemented Interfaces:
Serializer
public class JsonSerializer extends java.lang.Object implements Serializer
serialization of Reflections to jsonan example of produced json:
{"store":{"storeMap": {"org.reflections.scanners.TypeAnnotationsScanner":{ "org.reflections.TestModel$AC1":["org.reflections.TestModel$C1"], "org.reflections.TestModel$AC2":["org.reflections.TestModel$I3", ...
-
-
Field Summary
Fields Modifier and Type Field Description private com.google.gson.Gson
gson
-
Constructor Summary
Constructors Constructor Description JsonSerializer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private com.google.gson.Gson
getGson()
Reflections
read(java.io.InputStream inputStream)
reads the input stream into a new Reflections instance, populating it's storejava.io.File
save(Reflections reflections, java.lang.String filename)
saves a Reflections instance into the given filenamejava.lang.String
toString(Reflections reflections)
returns a string serialization of the given Reflections instance
-
-
-
Method Detail
-
read
public Reflections read(java.io.InputStream inputStream)
Description copied from interface:Serializer
reads the input stream into a new Reflections instance, populating it's store- Specified by:
read
in interfaceSerializer
-
save
public java.io.File save(Reflections reflections, java.lang.String filename)
Description copied from interface:Serializer
saves a Reflections instance into the given filename- Specified by:
save
in interfaceSerializer
-
toString
public java.lang.String toString(Reflections reflections)
Description copied from interface:Serializer
returns a string serialization of the given Reflections instance- Specified by:
toString
in interfaceSerializer
-
getGson
private com.google.gson.Gson getGson()
-
-