类 ClassCode

java.lang.Object
com.baidu.bjf.remoting.protobuf.code.ClassCode

public class ClassCode extends Object
Java class code creator.
从以下版本开始:
1.10.3
作者:
xiemalin
  • 字段详细资料

    • LINE_BREAK

      public static final String LINE_BREAK
      line break for editor.
      另请参阅:
    • JAVA_END

      public static final String JAVA_END
      java line end.
      另请参阅:
    • JAVA_LINE_BREAK

      public static final String JAVA_LINE_BREAK
      line break for JAVA.
      另请参阅:
    • PACKAGE_SPLIT

      public static final String PACKAGE_SPLIT
      The Constant PACKAGE_SPLIT.
      另请参阅:
    • SENTENCE_COMMA

      public static final String SENTENCE_COMMA
      The Constant SENTENCE_COMMA.
      另请参阅:
    • BLANK_STRING

      public static final String BLANK_STRING
      BLANK_STRING.
      另请参阅:
    • KEY_CLASS

      public static final String KEY_CLASS
      The Constant KEY_CLASS.
      另请参阅:
    • SCOPE_PUBLIC

      public static final String SCOPE_PUBLIC
      The Constant SCOPE_PUBLIC.
      另请参阅:
    • SCOPE_PROTECTED

      public static final String SCOPE_PROTECTED
      The Constant SCOPE_PROTECTED.
      另请参阅:
    • SCOPE_DEFAULT

      public static final String SCOPE_DEFAULT
      The Constant SCOPE_DEFAULT.
      另请参阅:
    • CODE_FORMAT

      public static final String CODE_FORMAT
      The Constant CODE_FORMAT.
      另请参阅:
  • 构造器详细资料

    • ClassCode

      public ClassCode(String scope, String name, Set<String> interfaces, Set<String> extendClasses)
      Instantiates a new class code.
      参数:
      scope - the scope
      name - the name
      interfaces - the interfaces
      extendClasses - the extend classes
    • ClassCode

      public ClassCode(String scope, String name)
      Instantiates a new class code.
      参数:
      scope - the scope
      name - the name
  • 方法详细资料

    • addField

      public void addField(String scope, String type, String name, String defaultValue)
      Adds the field.
      参数:
      scope - the scope
      type - the type
      name - the name
      defaultValue - the default value
    • toCode

      public String toCode()
      To code.
      返回:
      the string
    • importClass

      public void importClass(String importClass)
      Import java class.
      参数:
      importClass - imported java class
    • addMethod

      public ClassCode addMethod(MethodCode mc)
      Add a method to java source code.
      参数:
      mc - method code
      返回:
      ClassCode instance
    • setPkg

      public void setPkg(String pkg)
      Sets the pkg.
      参数:
      pkg - the new pkg
    • setClassName

      public void setClassName(String className)
      Sets the class name.
      参数:
      className - the new class name
    • addInteface

      public void addInteface(String intf)
      Adds the inteface.
      参数:
      intf - the intf
    • addExtendClass

      public void addExtendClass(String cls)
      Adds the extend class.
      参数:
      cls - the cls