public class MemberTemplate extends java.lang.Object implements Template
| Constructor and Description |
|---|
MemberTemplate(int modifiers,
java.lang.String type,
java.lang.String name)
Constructor
|
MemberTemplate(int modifiers,
java.lang.String type,
java.lang.String name,
java.lang.Object initialValue)
Constructor
|
MemberTemplate(java.lang.String type,
java.lang.String name)
Constructor
|
MemberTemplate(java.lang.String type,
java.lang.String name,
java.lang.Object initialValue)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addImport(java.lang.String name)
add an String as import to the top class of this element
|
JavaDocTemplate |
createJavadoc()
create a comment template for this class file
|
java.lang.Object |
getInitialValue()
get the initial value for this member
|
Template |
getParent()
get the direct parent of this element.
|
java.lang.String |
getType() |
void |
setInitialValue(java.lang.Object initialValue)
set the initial value for this member
|
void |
setParent(Template parent)
(non-Javadoc)
set the direct parent of this element
|
void |
setType(java.lang.String type) |
void |
write(java.io.PrintWriter pw,
int indent)
write the template information to the PrintWriter at the given
indention.
|
public MemberTemplate(java.lang.String type,
java.lang.String name)
Make a private member with the given name and type
type - String, representation of the typename - String, the name of the methodpublic MemberTemplate(java.lang.String type,
java.lang.String name,
java.lang.Object initialValue)
Make a private member with the given name and type
type - String, representation of the return valuename - String, the name of the methodinitialValue - Object, the initial value for this method, supply a Literal
object for a String or char that should be used as a Literal valuepublic MemberTemplate(int modifiers,
java.lang.String type,
java.lang.String name)
Make a member with the given name and type and with the given access.
modifiers - int, sum of the modifiers to use for this methodtype - String, representation of the return valuename - String, the name of the methodpublic MemberTemplate(int modifiers,
java.lang.String type,
java.lang.String name,
java.lang.Object initialValue)
Make a member with the given name and type and with the given access and initial value.
modifiers - int, sum of the modifiers to use for this methodtype - String, representation of the return valuename - String, the name of the methodinitialValue - Object, the initial value for this method, supply a Literal
object for a String or char that should be used as a Literal valuepublic void write(java.io.PrintWriter pw,
int indent)
Indention is multiplied by 4 to supply the spaces
for the indention.
public java.lang.Object getInitialValue()
public void setInitialValue(java.lang.Object initialValue)
initialValue - Object, the initial value for this member, supply a Literal
object for a String or char that should be used as a Literal valueLiteralpublic Template getParent()
This can be the class, method, try element or loop elements
public void setParent(Template parent)
The parent can be the class, method, try element or loop elements
public void addImport(java.lang.String name)
public java.lang.String getType()
public void setType(java.lang.String type)
type - The type of Loop to set (DO|WHILE|FOR).public JavaDocTemplate createJavadoc()