类 TemplateCodeGenerator

java.lang.Object
com.baidu.bjf.remoting.protobuf.code.AbstractCodeGenerator
com.baidu.bjf.remoting.protobuf.code.TemplateCodeGenerator
所有已实现的接口:
ICodeGenerator
直接已知子类:
RandomNameCodeGenerator

public class TemplateCodeGenerator extends AbstractCodeGenerator
Code generator utility class by template engine.
从以下版本开始:
1.12.0
作者:
xiemalin
  • 构造器详细资料

    • TemplateCodeGenerator

      public TemplateCodeGenerator(Class<?> cls)
      Instantiates a new template code generator.
      参数:
      cls - the cls
  • 方法详细资料

    • getClassName

      public String getClassName()
      Gets the class name.
      指定者:
      getClassName 在接口中 ICodeGenerator
      覆盖:
      getClassName 在类中 AbstractCodeGenerator
      返回:
      the class name
    • getCode

      public String getCode()
      Gets the code.
      返回:
      the code
    • initEncodeMethodTemplateVariable

      protected void initEncodeMethodTemplateVariable()
      Inits the encode method template variable.
    • initDecodeMethodTemplateVariable

      protected void initDecodeMethodTemplateVariable()
      Inits the decode method template variable.
    • getRelativeProxyClasses

      public Set<Class<?>> getRelativeProxyClasses()
      Gets the relative proxy classes.
      返回:
      the relative proxy classes
    • getSetToField

      protected String getSetToField(String target, Field field, Class<?> cls, String express, boolean isList, boolean isMap, boolean packed, boolean isWildType)
      generate access Field value source code. support public field access, getter method access and reflection access.
      参数:
      target - the target
      field - the field
      cls - the cls
      express - the express
      isList - the is list
      isMap - the is map
      packed - the packed
      返回:
      the sets the to field