public static MethodInvocationTree createMethodInvocation(WorkingCopy wc, String methodName, String[] pNames) { TreeMaker treeMaker = wc.getTreeMaker(); List<ExpressionTree> args = new ArrayList<ExpressionTree>(); for (int i = 0 ; pNames != null && i < pNames.length; i++) { ExpressionTree tree = treeMaker.Identifier(pNames[i]); args.add(tree); } return treeMaker.MethodInvocation(Collections.<ExpressionTree>emptyList(), treeMaker.Identifier(methodName), args); }
public static MethodInvocationTree createMethodInvocation(WorkingCopy wc, String beanName, String methodName, List<ExpressionTree> args) { TreeMaker treeMaker = wc.getTreeMaker(); return treeMaker.MethodInvocation(Collections.<ExpressionTree>emptyList(), treeMaker.MemberSelect(treeMaker.Identifier(beanName), methodName), args); }
statements.addFirst(make.ExpressionStatement(make.MethodInvocation(Collections.<ExpressionTree>emptyList(), make.Identifier("super"), arguments))); //NOI18N
fireArgs.add(make.Identifier(oldParameterName)); fireArgs.add(make.Identifier(parameterName)); MethodInvocationTree notification = make.MethodInvocation(Collections.EMPTY_LIST, fireMethod, fireArgs); newBlock = make.addBlockStatement(newBlock, make.ExpressionStatement(notification)); wc.rewrite(block, newBlock);
VariableTree changeSupport = make.Variable(parMods, "changeSupport", make.QualIdent(changeSupportElement), null); // NOI18N MemberSelectTree removeCall = make.MemberSelect(make.Identifier(changeSupport.getName()), "removePropertyChangeListener"); // NOI18N MethodInvocationTree removeInvocation = make.MethodInvocation(Collections.EMPTY_LIST, removeCall, Collections.singletonList(make.Identifier(par.getName()))); MethodTree removeMethod = make.Method( make.Modifiers(Modifier.PUBLIC, Collections.EMPTY_LIST),
VariableTree changeSupport = make.Variable(parMods, "changeSupport", make.QualIdent(changeSupportElement), null); // NOI18N MemberSelectTree addCall = make.MemberSelect(make.Identifier(changeSupport.getName()), "addPropertyChangeListener"); // NOI18N MethodInvocationTree addInvocation = make.MethodInvocation(Collections.EMPTY_LIST, addCall, Collections.singletonList(make.Identifier(par.getName()))); MethodTree addMethod = make.Method( make.Modifiers(Modifier.PUBLIC, Collections.EMPTY_LIST),