public class TemplateCodeGenerator extends AbstractCodeGenerator
cls, debug, fields, outputPathCLASS_JOINER, DEFAULT_SUFFIX_CLASSNAME, JAVA_CLASS_FILE_SUFFIX, JAVA_END, JAVA_LINE_BREAK, LINE_BREAK, PACKAGE_SPLIT| 构造器和说明 |
|---|
TemplateCodeGenerator(Class<?> cls)
Instantiates a new template code generator.
|
| 限定符和类型 | 方法和说明 |
|---|---|
String |
getClassName()
Gets the class name.
|
String |
getCode()
Gets the code.
|
Set<Class<?>> |
getRelativeProxyClasses()
Gets the relative proxy classes.
|
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. |
protected void |
initDecodeMethodTemplateVariable()
Inits the decode method template variable.
|
protected void |
initEncodeMethodTemplateVariable()
Inits the encode method template variable.
|
checkType, getAccessByField, getAllDependenciesClasses, getDependenciesClasses, getDependenciesClasses, getDependenciesClasses, getFullClassName, getOutputPath, getPackage, getTargetProxyClassname, isDebug, setDebug, setOutputPathpublic TemplateCodeGenerator(Class<?> cls)
cls - the clspublic String getClassName()
getClassName 在接口中 ICodeGeneratorgetClassName 在类中 AbstractCodeGeneratorpublic String getCode()
protected void initEncodeMethodTemplateVariable()
protected void initDecodeMethodTemplateVariable()
public Set<Class<?>> getRelativeProxyClasses()
protected String getSetToField(String target, Field field, Class<?> cls, String express, boolean isList, boolean isMap, boolean packed, boolean isWildType)
Field value 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 packedCopyright © 2022 Baidu, Inc.. All rights reserved.