}
@SuppressWarnings("unchecked")
@Override
public Object visit(Rule_smaliMethodRef rule) {
MethodRef ref = EntityFactory.createCommonMethodRef();
for(Rule innerRule : rule.rules) {
if(innerRule instanceof Rule_className)
ref.setClassName(innerRule.spelling);
else if(innerRule instanceof Rule_qualifier)
ref.setName(innerRule.spelling);
else if(innerRule instanceof Rule_smaliConstructorName) {
ref.setName(innerRule.spelling);
ref.setConstructor(true);
} else if(innerRule instanceof Rule_classMethodProto) {
List<Param> protoParams = (List<Param>)innerRule.accept(this);
ref.setReturnType(protoParams.remove(0).getType());
smaliClass.addImport(ref.getReturnType());
for(Param param : protoParams) {
ref.addParam(param);
smaliClass.addImport(param.getType());
}
}
}
return ref;