|
|||||||||
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 |
|
MemberTemplate(int modifiers,
java.lang.String type,
java.lang.String name,
java.lang.Object initialValue,
boolean literal)
Constructor |
|
MemberTemplate(java.lang.String type,
java.lang.String name)
Constructor |
|
MemberTemplate(java.lang.String type,
java.lang.String name,
java.lang.Object initialValue,
boolean literal)
Constructor |
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 |
java.lang.String |
getObjectName(java.lang.String name)
get the Class name without the package |
Template |
getParent()
get the direct parent of this element. |
void |
setInitialValue(java.lang.Object initialValue)
set the initial value for this member |
void |
setInitialValue(java.lang.Object initialValue,
boolean literal)
set the initial value for this member as literal |
void |
setParent(Template parent)
set the direct parent of this element |
void |
write(java.io.PrintWriter pw,
int indent)
write the template information to the PrintWriter at the given indention. |
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 return valuename
- String, the name of the methodpublic MemberTemplate(java.lang.String type, java.lang.String name, java.lang.Object initialValue, boolean literal)
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 methodliteral
- boolean, use the initial value as literal instead of a Stringpublic 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, boolean literal)
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 methodliteral
- boolean, use the initial value as literal instead of a StringMethod Detail |
public void write(java.io.PrintWriter pw, int indent)
Template
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
- Objectpublic void setInitialValue(java.lang.Object initialValue, boolean literal)
setting literal to false is same as setInitialValue(Object)
initialValue
- Object, initial valueliteral
- boolean, true if this is a literalpublic Template getParent()
Template
This can be the class, method, try element or loop elements
getParent
in interface Template
public void setParent(Template parent)
Template
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)
Template
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 getObjectName(java.lang.String name)
Template
getObjectName
in interface Template
name
- String, a classname with or without a package
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |