Class JsonSerializer

  • All Implemented Interfaces:
    Serializer

    public class JsonSerializer
    extends java.lang.Object
    implements Serializer
    json serialization for Reflections
    reflections.save(file, new JsonSerializer())

    an example of produced json:
    
     {
       "store": {
         "SubTypes": {
           "org.reflections.TestModel$C1": [
             "org.reflections.TestModel$C2",
             "org.reflections.TestModel$C3"
           ]
         },
         "TypesAnnotated": {
           "org.reflections.TestModel$AC2": [
             "org.reflections.TestModel$C2",
             "org.reflections.TestModel$C3"
           ]
         }
       }
     }
     
    • Constructor Summary

      Constructors 
      Constructor Description
      JsonSerializer()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Reflections read​(java.io.InputStream inputStream)
      reads the input stream into a new Reflections instance, populating it's store
      java.io.File save​(Reflections reflections, java.lang.String filename)
      saves a Reflections instance into the given filename
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JsonSerializer

        public JsonSerializer()
    • 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 interface Serializer
      • 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 interface Serializer