Class SourceCode.Element<T>
- java.lang.Object
-
- org.apache.openjpa.persistence.util.SourceCode.Element<T>
-
- All Implemented Interfaces:
java.lang.Comparable<SourceCode.Element<T>>
- Direct Known Subclasses:
SourceCode.Class
,SourceCode.Constructor
,SourceCode.Field
,SourceCode.Method
- Enclosing class:
- SourceCode
public abstract class SourceCode.Element<T> extends java.lang.Object implements java.lang.Comparable<SourceCode.Element<T>>
Abstract element has a name, optional list of modifiers, annotations and arguments.
-
-
Field Summary
Fields Modifier and Type Field Description protected SourceCode.ACCESS
access
protected java.util.List<SourceCode.Annotation>
annos
protected org.apache.openjpa.persistence.util.SourceCode.Comment
comment
protected boolean
isFinal
protected boolean
isStatic
protected java.lang.String
name
protected java.util.List<org.apache.openjpa.persistence.util.SourceCode.ClassName>
params
protected org.apache.openjpa.persistence.util.SourceCode.ClassName
type
-
Constructor Summary
Constructors Modifier Constructor Description protected
Element(java.lang.String name, org.apache.openjpa.persistence.util.SourceCode.ClassName type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SourceCode.Annotation
addAnnotation(java.lang.String a)
T
addComment(boolean inline, java.lang.String... lines)
SourceCode.Element<T>
addParameter(java.lang.String param)
int
compareTo(SourceCode.Element<T> other)
org.apache.openjpa.persistence.util.SourceCode.ClassName
getType()
T
makeFinal()
T
makePrivate()
T
makeProtected()
T
makePublic()
T
makeStatic()
void
write(java.io.PrintWriter out, int tab)
-
-
-
Field Detail
-
name
protected java.lang.String name
-
type
protected org.apache.openjpa.persistence.util.SourceCode.ClassName type
-
access
protected SourceCode.ACCESS access
-
isStatic
protected boolean isStatic
-
isFinal
protected boolean isFinal
-
comment
protected org.apache.openjpa.persistence.util.SourceCode.Comment comment
-
params
protected java.util.List<org.apache.openjpa.persistence.util.SourceCode.ClassName> params
-
annos
protected java.util.List<SourceCode.Annotation> annos
-
-
Method Detail
-
getType
public org.apache.openjpa.persistence.util.SourceCode.ClassName getType()
-
addAnnotation
public SourceCode.Annotation addAnnotation(java.lang.String a)
-
addParameter
public SourceCode.Element<T> addParameter(java.lang.String param)
-
compareTo
public int compareTo(SourceCode.Element<T> other)
- Specified by:
compareTo
in interfacejava.lang.Comparable<T>
-
addComment
public T addComment(boolean inline, java.lang.String... lines)
-
makePublic
public T makePublic()
-
makeProtected
public T makeProtected()
-
makePrivate
public T makePrivate()
-
makeStatic
public T makeStatic()
-
makeFinal
public T makeFinal()
-
write
public void write(java.io.PrintWriter out, int tab)
-
-