public class SourceCode extends Object
Modifier and Type | Class and Description |
---|---|
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.Constructor |
class |
SourceCode.Element<T>
Abstract element has a name, optional list of modifiers, annotations
and arguments.
|
class |
SourceCode.Field
Represents field declaration.
|
class |
SourceCode.Method
Represents Method declaration.
|
Modifier and Type | Field and Description |
---|---|
static String |
COMMA |
static String |
DOT |
static String |
EQUAL |
static String |
QUOTE |
Constructor and Description |
---|
SourceCode(String c)
Create source code for a top-level class with given fully-qualified
class name.
|
Modifier and Type | Method and Description |
---|---|
SourceCode |
addComment(boolean inline,
String... lines) |
org.apache.openjpa.persistence.util.SourceCode.ClassName |
getOrCreateImport(String name)
Get the class name instance for the given fully-qualified class name.
|
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.
|
public static final String COMMA
public static final String DOT
public static final String EQUAL
public static final String QUOTE
public SourceCode(String c)
public SourceCode.Class getTopLevelClass()
public org.apache.openjpa.persistence.util.SourceCode.Package getPackage()
public SourceCode setTabSize(int t)
public org.apache.openjpa.persistence.util.SourceCode.ClassName getOrCreateImport(String name)
name
- fully-qualified name of a classaddImport(ClassName)
,
ClassName
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)
Copyright © 2006–2017 Apache Software Foundation. All rights reserved.