|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectkoala.dynamicjava.tree.Node
koala.dynamicjava.tree.Declaration
koala.dynamicjava.tree.FieldDeclaration
public class FieldDeclaration
This class represents field declarations in an AST
| Constructor Summary | |
|---|---|
FieldDeclaration(ModifierSet mods,
TypeName type,
java.lang.String name,
Expression init)
Creates a new field declaration |
|
FieldDeclaration(ModifierSet mods,
TypeName type,
java.lang.String name,
Expression init,
SourceInfo si)
Creates a new field declaration |
|
| Method Summary | ||
|---|---|---|
|
acceptVisitor(Visitor<T> visitor)
Allows a visitor to traverse the tree |
|
Expression |
getInitializer()
Returns the initializer for this field |
|
java.lang.String |
getName()
Returns the name of this field |
|
TypeName |
getType()
Gets the declared type for this field |
|
void |
setInitializer(Expression e)
Sets the initializer |
|
void |
setName(java.lang.String s)
Sets the field's name |
|
void |
setType(TypeName t)
Sets the type of this field |
|
java.lang.String |
toString()
Implementation of toString for use in unit testing |
|
| Methods inherited from class koala.dynamicjava.tree.Declaration |
|---|
getModifiers, setModifiers |
| Methods inherited from class koala.dynamicjava.tree.Node |
|---|
archiveProperties, getProperties, getProperty, getSourceInfo, hasProperty, setProperty, setSourceInfo |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public FieldDeclaration(ModifierSet mods,
TypeName type,
java.lang.String name,
Expression init)
mods - the modifierstype - the type of this fieldname - the name of this fieldinit - the initializer. Can be null
java.lang.IllegalArgumentException - if name is null or type is null
public FieldDeclaration(ModifierSet mods,
TypeName type,
java.lang.String name,
Expression init,
SourceInfo si)
mods - the modifierstype - the type of this fieldname - the name of this fieldinit - the initializer. Can be null
java.lang.IllegalArgumentException - if name is null or type is null| Method Detail |
|---|
public TypeName getType()
public void setType(TypeName t)
java.lang.IllegalArgumentException - if t is nullpublic java.lang.String getName()
public void setName(java.lang.String s)
java.lang.IllegalArgumentException - if s is nullpublic Expression getInitializer()
public void setInitializer(Expression e)
public <T> T acceptVisitor(Visitor<T> visitor)
acceptVisitor in class Nodevisitor - the visitor to acceptpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||