|
||||||||||
| 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.MethodDeclaration
public class MethodDeclaration
This class represents method declarations in an AST
| Constructor Summary | |
|---|---|
MethodDeclaration(ModifierSet mods,
Option<java.util.List<TypeParameter>> tparams,
TypeName type,
java.lang.String name,
java.util.List<FormalParameter> params,
java.util.List<? extends ReferenceTypeName> excepts,
BlockStatement body)
Creates a new method declaration |
|
MethodDeclaration(ModifierSet mods,
Option<java.util.List<TypeParameter>> tparams,
TypeName type,
java.lang.String name,
java.util.List<FormalParameter> params,
java.util.List<? extends ReferenceTypeName> excepts,
BlockStatement body,
SourceInfo si)
Creates a new method declaration |
|
MethodDeclaration(ModifierSet mods,
TypeName type,
java.lang.String name,
java.util.List<FormalParameter> params,
java.util.List<? extends ReferenceTypeName> excepts,
BlockStatement body)
Creates a new method declaration |
|
MethodDeclaration(ModifierSet mods,
TypeName type,
java.lang.String name,
java.util.List<FormalParameter> params,
java.util.List<? extends ReferenceTypeName> excepts,
BlockStatement body,
SourceInfo si)
Creates a new method declaration |
|
| Method Summary | ||
|---|---|---|
|
acceptVisitor(Visitor<T> visitor)
Allows a visitor to traverse the tree |
|
BlockStatement |
getBody()
Returns the body of the method, null if the method is abstract |
|
java.util.List<? extends ReferenceTypeName> |
getExceptions()
Returns the list of the exception thrown by this method |
|
java.lang.String |
getName()
Returns the name of this method |
|
java.util.List<FormalParameter> |
getParameters()
Returns the parameters list |
|
TypeName |
getReturnType()
Gets the return type of this method |
|
Option<java.util.List<TypeParameter>> |
getTypeParams()
|
|
void |
setBody(BlockStatement bs)
Sets the body |
|
void |
setExceptions(java.util.List<? extends ReferenceTypeName> l)
Sets the exceptions list |
|
void |
setName(java.lang.String s)
Sets the method's name |
|
void |
setParameters(java.util.List<FormalParameter> l)
Sets the parameters list |
|
void |
setReturnType(TypeName t)
Sets the return type of this method |
|
void |
setTypeArgs(java.util.List<TypeParameter> tparams)
|
|
void |
setTypeArgs(Option<java.util.List<TypeParameter>> tparams)
|
|
java.lang.String |
toString()
Implementation of toString for use in unit testing |
|
java.lang.String |
toStringHelper()
|
|
| 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 MethodDeclaration(ModifierSet mods,
TypeName type,
java.lang.String name,
java.util.List<FormalParameter> params,
java.util.List<? extends ReferenceTypeName> excepts,
BlockStatement body)
mods - the modifierstype - the return type of this methodname - the name of the method to declareparams - the parameters listexcepts - the exception listbody - the body statement
java.lang.IllegalArgumentException - if name is null or type is null or
params is null or excepts is null
public MethodDeclaration(ModifierSet mods,
Option<java.util.List<TypeParameter>> tparams,
TypeName type,
java.lang.String name,
java.util.List<FormalParameter> params,
java.util.List<? extends ReferenceTypeName> excepts,
BlockStatement body)
mods - the modifierstparams - type parameterstype - the return type of this methodname - the name of the method to declareparams - the parameters listexcepts - the exception listbody - the body statement
java.lang.IllegalArgumentException - if name is null or type is null or
params is null or excepts is null
public MethodDeclaration(ModifierSet mods,
TypeName type,
java.lang.String name,
java.util.List<FormalParameter> params,
java.util.List<? extends ReferenceTypeName> excepts,
BlockStatement body,
SourceInfo si)
mods - the modifierstype - the return type of this methodname - the name of the method to declareparams - the parameters listexcepts - the exception listbody - the body statement
java.lang.IllegalArgumentException - if name is null or type is null or
params is null or excepts is null
public MethodDeclaration(ModifierSet mods,
Option<java.util.List<TypeParameter>> tparams,
TypeName type,
java.lang.String name,
java.util.List<FormalParameter> params,
java.util.List<? extends ReferenceTypeName> excepts,
BlockStatement body,
SourceInfo si)
mods - the modifierstparams - type parameterstype - the return type of this methodname - the name of the method to declareparams - the parameters listexcepts - the exception listbody - the body statement
java.lang.IllegalArgumentException - if name is null or type is null or
params is null or excepts is null| Method Detail |
|---|
public Option<java.util.List<TypeParameter>> getTypeParams()
public void setTypeArgs(java.util.List<TypeParameter> tparams)
public void setTypeArgs(Option<java.util.List<TypeParameter>> tparams)
public TypeName getReturnType()
public void setReturnType(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 java.util.List<FormalParameter> getParameters()
public void setParameters(java.util.List<FormalParameter> l)
java.lang.IllegalArgumentException - if l is nullpublic java.util.List<? extends ReferenceTypeName> getExceptions()
public void setExceptions(java.util.List<? extends ReferenceTypeName> l)
java.lang.IllegalArgumentException - if l is nullpublic BlockStatement getBody()
public void setBody(BlockStatement bs)
public <T> T acceptVisitor(Visitor<T> visitor)
acceptVisitor in class Nodevisitor - the visitor to acceptpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toStringHelper()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||