类 TemplateCodeGenerator
java.lang.Object
com.baidu.bjf.remoting.protobuf.code.AbstractCodeGenerator
com.baidu.bjf.remoting.protobuf.code.TemplateCodeGenerator
- 所有已实现的接口:
ICodeGenerator
- 直接已知子类:
RandomNameCodeGenerator
Code generator utility class by template engine.
- 从以下版本开始:
- 1.12.0
- 作者:
- xiemalin
-
字段概要
从类继承的字段 com.baidu.bjf.remoting.protobuf.code.AbstractCodeGenerator
cls, debug, fields, outputPath从接口继承的字段 com.baidu.bjf.remoting.protobuf.code.ICodeGenerator
CLASS_JOINER, DEFAULT_SUFFIX_CLASSNAME, JAVA_CLASS_FILE_SUFFIX, JAVA_END, JAVA_LINE_BREAK, LINE_BREAK, PACKAGE_SPLIT -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明Gets the class name.getCode()Gets the code.Gets the relative proxy classes.protected StringgetSetToField(String target, Field field, Class<?> cls, String express, boolean isList, boolean isMap, boolean packed, boolean isWildType) generate accessFieldvalue source code. support public field access, getter method access and reflection access.protected voidInits the decode method template variable.protected voidInits the encode method template variable.从类继承的方法 com.baidu.bjf.remoting.protobuf.code.AbstractCodeGenerator
checkType, getAccessByField, getAllDependenciesClasses, getDependenciesClasses, getDependenciesClasses, getDependenciesClasses, getFullClassName, getOutputPath, getPackage, getTargetProxyClassname, isDebug, setDebug, setOutputPath
-
构造器详细资料
-
TemplateCodeGenerator
Instantiates a new template code generator.- 参数:
cls- the cls
-
-
方法详细资料
-
getClassName
Gets the class name.- 指定者:
getClassName在接口中ICodeGenerator- 覆盖:
getClassName在类中AbstractCodeGenerator- 返回:
- the class name
-
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
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 accessFieldvalue source code. support public field access, getter method access and reflection access.- 参数:
target- the targetfield- the fieldcls- the clsexpress- the expressisList- the is listisMap- the is mappacked- the packed- 返回:
- the sets the to field
-