public class ClassCode extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
BLANK_STRING
BLANK_STRING.
|
static String |
CODE_FORMAT
The Constant CODE_FORMAT.
|
static String |
JAVA_END
java line end.
|
static String |
JAVA_LINE_BREAK
line break for JAVA.
|
static String |
KEY_CLASS
The Constant KEY_CLASS.
|
static String |
LINE_BREAK
line break for editor.
|
static String |
PACKAGE_SPLIT
The Constant PACKAGE_SPLIT.
|
static String |
SCOPE_DEFAULT
The Constant SCOPE_DEFAULT.
|
static String |
SCOPE_PROTECTED
The Constant SCOPE_PROTECTED.
|
static String |
SCOPE_PUBLIC
The Constant SCOPE_PUBLIC.
|
static String |
SENTENCE_COMMA
The Constant SENTENCE_COMMA.
|
| 构造器和说明 |
|---|
ClassCode(String scope,
String name)
Instantiates a new class code.
|
ClassCode(String scope,
String name,
Set<String> interfaces,
Set<String> extendClasses)
Instantiates a new class code.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addExtendClass(String cls)
Adds the extend class.
|
void |
addField(String scope,
String type,
String name,
String defaultValue)
Adds the field.
|
void |
addInteface(String intf)
Adds the inteface.
|
ClassCode |
addMethod(MethodCode mc)
Add a method to java source code.
|
void |
importClass(String importClass)
Import java class.
|
void |
setClassName(String className)
Sets the class name.
|
void |
setPkg(String pkg)
Sets the pkg.
|
String |
toCode()
To code.
|
public static final String SCOPE_PROTECTED
public ClassCode(String scope, String name, Set<String> interfaces, Set<String> extendClasses)
scope - the scopename - the nameinterfaces - the interfacesextendClasses - the extend classespublic void addField(String scope, String type, String name, String defaultValue)
scope - the scopetype - the typename - the namedefaultValue - the default valuepublic String toCode()
public void importClass(String importClass)
importClass - imported java classpublic ClassCode addMethod(MethodCode mc)
mc - method codeClassCode instancepublic void setPkg(String pkg)
pkg - the new pkgpublic void setClassName(String className)
className - the new class namepublic void addInteface(String intf)
intf - the intfpublic void addExtendClass(String cls)
cls - the clsCopyright © 2022 Baidu, Inc.. All rights reserved.