|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.enough.polish.sourceparser.JavaSourceClass
public class JavaSourceClass
Parses Java source code and provides reflection-like information about it.
Copyright Enough Software 2006
history
Dec 28, 2006 - rob creation
| Field Summary | |
|---|---|
protected static Pattern |
CLASSNAME_PATTERN
|
protected static String |
CLASSNAME_STR
|
protected static Pattern |
EXTENDS_PATTERN
|
protected static String |
EXTENDS_STR
|
protected static Pattern |
IMPLEMENTS_PATTERN
|
protected static String |
IMPLEMENTS_STR
|
protected static Pattern |
IMPORT_PATTERN
|
protected static String |
IMPORT_STR
|
protected static String |
JAVA_VAR_STR
|
protected static Pattern |
METHOD_PATTERN
|
protected static String |
METHOD_STR
|
protected static Pattern |
PACKAGE_PATTERN
|
protected static String |
PACKAGE_STR
|
| Constructor Summary | |
|---|---|
JavaSourceClass(String[] lines)
Creates a new Java source file. |
|
| Method Summary | |
|---|---|
void |
addImport(String importStatement)
|
void |
addMethod(JavaSourceMethod method)
|
String |
getClassName()
|
String |
getExtendsStatement()
|
String[] |
getImplementedInterfaces()
|
String[] |
getImportStatements()
|
JavaSourceMethod[] |
getMethods()
|
String |
getPackageName()
|
boolean |
isClass()
|
void |
parse(String[] lines)
Parses the given Java source code. |
static String[] |
removeComments(String[] lines)
Removes any Java comments from the given source code. |
String[] |
renderCode()
|
void |
setClass(boolean isClass)
|
void |
setClassName(String className)
|
void |
setExtendsStatement(String extendsStatement)
|
void |
setImplementedInterfaces(String[] implementedInterfaces)
|
void |
setImportStatements(String[] importStatements)
|
void |
setMethods(JavaSourceMethod[] methods)
|
void |
setPackageName(String packageName)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final String JAVA_VAR_STR
protected static final String PACKAGE_STR
protected static final Pattern PACKAGE_PATTERN
protected static final String IMPORT_STR
protected static final Pattern IMPORT_PATTERN
protected static final String CLASSNAME_STR
protected static final Pattern CLASSNAME_PATTERN
protected static final String EXTENDS_STR
protected static final Pattern EXTENDS_PATTERN
protected static final String IMPLEMENTS_STR
protected static final Pattern IMPLEMENTS_PATTERN
protected static final String METHOD_STR
protected static final Pattern METHOD_PATTERN
| Constructor Detail |
|---|
public JavaSourceClass(String[] lines)
lines - the source code| Method Detail |
|---|
public void parse(String[] lines)
lines - the source codepublic static String[] removeComments(String[] lines)
lines - the original source code
public String getClassName()
public String[] getImportStatements()
public boolean isClass()
public String getPackageName()
public String getExtendsStatement()
public String[] getImplementedInterfaces()
public JavaSourceMethod[] getMethods()
public void setMethods(JavaSourceMethod[] methods)
methods - the methods to setpublic void setClassName(String className)
className - the className to setpublic void setExtendsStatement(String extendsStatement)
extendsStatement - the extendsStatement to setpublic void setImplementedInterfaces(String[] implementedInterfaces)
implementedInterfaces - the implementedInterfaces to setpublic void setImportStatements(String[] importStatements)
importStatements - the importStatements to setpublic void setClass(boolean isClass)
isClass - the isClass to setpublic void setPackageName(String packageName)
packageName - the packageName to setpublic String[] renderCode()
public void addImport(String importStatement)
public void addMethod(JavaSourceMethod method)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||