类 GsonOptimizer

  • 所有已实现的接口:
    Pass

    public class GsonOptimizer
    extends java.lang.Object
    implements Pass
    This pass is the entry point for the GSON optimizations. The optimization roughly performs the following steps: - Find all usages of GSON in the program code: calls to toJson() or fromJson(). - Derive the domain classes that are involved in the GSON call, either directly (passed as argument to GSON) or indirectly (a field or element type of another domain class). - Inject optimized methods into the domain classes that serialize and deserialize the fields of the domain class without relying on reflection. - Inject and register GSON type adapters that utilize the optimized serialization and deserialization methods on the domain classes and bypass the reflective GSON implementation. As an additional protection measure, the JSON field names are assigned to a field index. The mapping between field indices and field names is done from the classes _OptimizedJsonReaderImpl and _OptimizedJsonWriterImpl, which have String encryption applied to them. This allows injecting serialization and deserialization code into the domain classes that have no JSON field names stored in them as plain text.
    • 字段概要

      字段 
      修饰符和类型 字段 说明
      static boolean DEBUG  
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      void execute​(AppView appView)
      Performs the Gson optimizations.
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 字段详细资料

    • 构造器详细资料

      • GsonOptimizer

        public GsonOptimizer​(Configuration configuration)
    • 方法详细资料

      • execute

        public void execute​(AppView appView)
                     throws java.io.IOException
        Performs the Gson optimizations.
        指定者:
        execute 在接口中 Pass
        抛出:
        java.io.IOException - when the injected template classes cannot be read.