public class CodeGenerator extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
JAVA_CLASS_FILE_SUFFIX |
static String |
JAVA_END
java line end
|
static String |
JAVA_LINE_BREAK
line break for JAVA
|
static String |
LINE_BREAK
line break for editor
|
static String |
PACKAGE_SPLIT |
| 构造器和说明 |
|---|
CodeGenerator(List<FieldInfo> fields,
Class<?> cls)
Constructor method
|
| 限定符和类型 | 方法和说明 |
|---|---|
protected String |
getAccessByField(String target,
Field field,
Class<?> cls)
get field access code
|
String |
getClassName()
get new class name
|
String |
getCode()
get full java class code.
|
String |
getFullClassName()
get new class name with full package
|
String |
getPackage() |
Set<Class<?>> |
getRelativeProxyClasses()
get relativeProxyClasses
|
protected String |
getSetToField(String target,
Field field,
Class<?> cls,
String express,
boolean isList,
boolean isMap)
generate access
Field value source code. support public field
access, getter method access and reflection access. |
boolean |
isDebug()
get the debug
|
void |
setDebug(boolean debug)
set debug value to debug
|
void |
setOutputPath(File outputPath)
set outputPath value to outputPath
|
public Set<Class<?>> getRelativeProxyClasses()
public void setOutputPath(File outputPath)
outputPath - the outputPath to setpublic boolean isDebug()
public void setDebug(boolean debug)
debug - the debug to setpublic String getClassName()
public String getPackage()
public String getFullClassName()
public String getCode()
protected String getAccessByField(String target, Field field, Class<?> cls)
target - target instance namefield - java field instancecls - mapped classCopyright © 2016 Baidu, Inc.. All rights reserved.