public class JcaMethod extends JcaCommon
| 构造器和说明 |
|---|
JcaMethod(com.sun.tools.javac.code.Symbol.MethodSymbol methodSym) |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
equals(Object o) |
List<JcaObject> |
getArgs()
获取方法的参数
|
JcaClass |
getJcaClass() |
String |
getMethodName()
获取方法名
|
com.sun.tools.javac.code.Symbol.MethodSymbol |
getMethodSym() |
JcaObject |
getReturnType()
获取方法的返回类型
|
int |
hashCode() |
boolean |
hasModifier(int modifier)
判断方法是不是有某个修饰符
|
boolean |
hasReturnValue()
判断方法是否有返回值
|
JcaMethod |
insert(JcaObject express)
在方法第一行插入一个表达式
|
JcaMethod |
insert(JcaVariable jcaVariable)
在方法第一行插入一个变量
|
JcaMethod |
insertBlock(JcaObject statement)
在方法第一行插入一个代码块
|
boolean |
isStatic()
判断方法是不是静态的
|
JcaObject |
onReturn(JcaObject returnValue)
方法返回的回调
|
JcaMethod |
setModifier(int modifier)
设置方法的修饰符
|
JcaMethod |
visitReturn()
处理方法的返回值,遇到方法返回处,会回调onReturn。
|
public JcaClass getJcaClass()
public com.sun.tools.javac.code.Symbol.MethodSymbol getMethodSym()
public JcaMethod insert(JcaVariable jcaVariable)
jcaVariable - 变量public JcaMethod insertBlock(JcaObject statement)
statement - 代码块public String getMethodName()
public JcaMethod setModifier(int modifier)
modifier - 修饰符public JcaObject getReturnType()
public boolean hasReturnValue()
public JcaObject onReturn(JcaObject returnValue)
returnValue - 返回值public JcaMethod visitReturn()
public boolean isStatic()
public boolean hasModifier(int modifier)
Copyright © 2018. All rights reserved.