|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.brains2b.typewriter.MemberTemplate
Template for creating a Member in a class
Constructor Summary | |
MemberTemplate(int modifiers,
java.lang.String type,
java.lang.String name)
Constructor Make a member with the given name and type and with the given access. |
|
MemberTemplate(int modifiers,
java.lang.String type,
java.lang.String name,
java.lang.Object initialValue)
Constructor Make a member with the given name and type and with the given access and initial value. |
|
MemberTemplate(java.lang.String type,
java.lang.String name)
Constructor Make a private member with the given name and type |
|
MemberTemplate(java.lang.String type,
java.lang.String name,
java.lang.Object initialValue)
Constructor Make a private member with the given name and type |
Method Summary | |
void |
addImport(java.lang.String name)
add an String as import to the top class of this element |
java.lang.Object |
getInitialValue()
get the initial value for this member |
Template |
getParent()
get the direct parent of this element. This can be the class, method, try element or loop elements |
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 The parent can be the class, method, try element or loop elements |
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. Indention is multiplied by |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
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 valueMethod Detail |
public void write(java.io.PrintWriter pw, int indent)
Indention is multiplied by 4
to supply the spaces
for the indention.
write
in interface Template
pw
- PrintWriter, an initialized PrintWriter to write this
element of the Class toindent
- int, the indention for this element.
Value is multiplied by four to give the number of spaces used for 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 valueLiteral
public Template getParent()
This can be the class, method, try element or loop elements
getParent
in interface Template
public void setParent(Template parent)
The parent can be the class, method, try element or loop elements
setParent
in interface Template
parent
- Template, the parent of this elementpublic void addImport(java.lang.String name)
addImport
in interface Template
name
- String, the fully qualified class name. Could be used
to enter the complete package by adding *
public java.lang.String getType()
public void setType(java.lang.String type)
type
- The type of Loop to set (DO|WHILE|FOR).
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |