|
Arch4J 1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.arch4j.generator.JavaDefinition
This class is used to define a set of attributes common to many
parts of a Java source file. This class is declared abstract
,
so subclasses may implement different parts of a Java source file.
An instance of one of these subclasses is an atomic definition for
one part of a Java source file, such as a method, constructor, or field.
Field Summary | |
protected JavaAccessModifier |
accessModifier
The access control modifier. |
protected String |
comment
A descriptive line of comments. |
Constructor Summary | |
JavaDefinition(String comment,
JavaAccessModifier accessModifier)
Constructs a JavaDefinition with the specified
comment and access control modifier. |
|
JavaDefinition(String comment,
String accessModifier)
Constructs a JavaDefinition with the specified
comment and access control modifier. |
Method Summary | |
JavaAccessModifier |
getAccessModifier()
Returns the access control modifier. |
String |
getComment()
Returns the comment. |
String |
getDefinition()
Returns a String containing the Java source representation of the definition. |
abstract List |
getImports()
Returns a list of potential import types for the definition. |
boolean |
hasComment()
Returns whether the definition has a comment or not. |
protected void |
setAccessModifier(JavaAccessModifier newModifier)
Set the access control modifier. |
void |
setComment(String newComment)
Set the comment. |
abstract void |
writeDefinitionTo(CodeBuffer buffer)
Write the Java source representation of the definition to the CodeBuffer . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected String comment
protected JavaAccessModifier accessModifier
Constructor Detail |
public JavaDefinition(String comment, String accessModifier)
JavaDefinition
with the specified
comment and access control modifier.
comment
- The definition's comment.accessModifier
- The definition's access control modifier.public JavaDefinition(String comment, JavaAccessModifier accessModifier)
JavaDefinition
with the specified
comment and access control modifier.
comment
- The definition's comment.accessModifier
- The definition's access control modifier.Method Detail |
public String getComment()
public void setComment(String newComment)
newComment
- The comment.public boolean hasComment()
public JavaAccessModifier getAccessModifier()
protected void setAccessModifier(JavaAccessModifier newModifier)
null
modifier is given, access control will be set to
package access.
newModifier
- The access control modifier.public String getDefinition()
public abstract List getImports()
public abstract void writeDefinitionTo(CodeBuffer buffer)
CodeBuffer
.
buffer
- The CodeBuffer with which to append the data.CodeBuffer
|
Arch4J 1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |