|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.openjpa.persistence.util.SourceCode
public class SourceCode
A utility to help writing Java Source code dynamically. Provides basic elements of Java Source Code e.g. Package, Class, Field, Method, Import, Annotation, Argument. Mutator methods return the operating element for easy chaining.
Nested Class Summary | |
---|---|
static class |
SourceCode.ACCESS
|
class |
SourceCode.Annotation
Represents annotation. |
class |
SourceCode.Argument<K,V>
Represents method argument. |
class |
SourceCode.Class
Represent class declaration. |
class |
SourceCode.Element<T>
Abstract element has a name, optional list of modifiers, annotations and arguments. |
class |
SourceCode.Field
Represents field declaration. |
Field Summary | |
---|---|
static String |
COMMA
|
static String |
DOT
|
static String |
EQUAL
|
static String |
QUOTE
|
Constructor Summary | |
---|---|
SourceCode(String c)
Create source code for a top-level class with given fully-qualified class name. |
Method Summary | |
---|---|
SourceCode |
addComment(boolean inline,
String... lines)
|
org.apache.openjpa.persistence.util.SourceCode.Package |
getPackage()
|
SourceCode.Class |
getTopLevelClass()
Gets the top level class represented by this receiver. |
static boolean |
isJavaIdentifier(String s)
|
static boolean |
isKnownType(String s)
|
SourceCode |
setTabSize(int t)
Sets the tab size. |
static String[] |
wrap(String longLine,
int width)
Wraps the given string into lines of max length width at word boundaries |
void |
write(PrintWriter out)
Prints the class to the given Writer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String COMMA
public static final String DOT
public static final String EQUAL
public static final String QUOTE
Constructor Detail |
---|
public SourceCode(String c)
Method Detail |
---|
public SourceCode.Class getTopLevelClass()
public org.apache.openjpa.persistence.util.SourceCode.Package getPackage()
public SourceCode setTabSize(int t)
public SourceCode addComment(boolean inline, String... lines)
public void write(PrintWriter out)
out
- public static String[] wrap(String longLine, int width)
public static boolean isKnownType(String s)
public static boolean isJavaIdentifier(String s)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |