public final class GeneratedCodeMethod extends Object implements CodeMethod
These are instantiated by factory methods on GeneratedCodeClass
, and
can not be instantiated directly.
Modifier and Type | Method and Description |
---|---|
void |
addThrownException(CodeClass cc)
Adds a feature to the ThrownException attribute of the GeneratedCodeMethod object
|
CodeClass |
getContainingClass()
The class that contains this method
|
String |
getDescriptor()
A human-readable description of the class
|
String |
getFullName()
The fully qualified name for this class
|
int |
getModifiers()
Get the modifiers, such as PUBLIC, ABSTRACT and so on
|
String |
getName()
The name of the method.
|
CodeClass |
getParameterType(int pos)
Get the type of the parameter at a given position
|
CodeClass |
getReturnType()
Get the return type
|
LocalVariable |
getThis()
Gets the This attribute of the GeneratedCodeMethod object
|
Set |
getThrownExceptions()
Gets the ThrownExceptions attribute of the GeneratedCodeMethod object
|
LocalVariable |
getVariable(int pos)
Gets the Variable attribute of the GeneratedCodeMethod object.
|
LocalVariable |
getVariable(String argName)
Gets the Variable attribute of the GenerateCodeMethod object by name.
|
int |
numParameters()
Get the number of parameters taken by this method
|
public String getName()
CodeMethod
getName
in interface CodeMethod
public String getFullName()
CodeMethod
getFullName
in interface CodeMethod
public CodeClass getContainingClass()
CodeMethod
getContainingClass
in interface CodeMethod
public String getDescriptor()
CodeMethod
getDescriptor
in interface CodeMethod
public int getModifiers()
CodeMethod
getModifiers
in interface CodeMethod
public CodeClass getReturnType()
CodeMethod
getReturnType
in interface CodeMethod
public int numParameters()
CodeMethod
numParameters
in interface CodeMethod
public CodeClass getParameterType(int pos)
CodeMethod
getParameterType
in interface CodeMethod
pos
- the position to fetch the parameter type forpublic LocalVariable getVariable(int pos)
There is one local variable for each of the arguments of the method, indexed from 0.
pos
- the index of the local variablepublic LocalVariable getVariable(String argName) throws NoSuchElementException
All methods have a variable under the string "this". If it was constructed with a String [] naming the args, the locals for each local can be retrieved by name.
argName
- a String naming the localNoSuchElementException
- if there is no local with that namepublic LocalVariable getThis()
public Set getThrownExceptions()
public void addThrownException(CodeClass cc)
cc
- The feature to be added to the ThrownException attributeCopyright © 2014 BioJava. All rights reserved.