final String name = memberValuePair.getName(); final Expression value = memberValuePair.getValue(); final Class<?> type = fieldsMap.get(name);
public void visit(MemberValuePair n, Object arg) { printer.print(n.getName()); printer.print(" = "); n.getValue().accept(this, arg); }
@Override public void visit(MethodDeclaration method, A result) { if (CollectionUtils.isEmpty(method.getAnnotations())) { return; } for (AnnotationExpr annotation : method.getAnnotations()) { if (!annotation.getClass().equals(NormalAnnotationExpr.class)) { continue; } NormalAnnotationExpr annot = (NormalAnnotationExpr) annotation; if (annot.getName().toString().equals(SampleCode.class.getSimpleName()) && !CollectionUtils.isEmpty(annot.getPairs())) { for (MemberValuePair pair : annot.getPairs()) { // get the 'api' parameter from the annotation to let us know which api this function belongs to if (StringUtils.equals(pair.getName(), "api") && !StringUtils.isBlank(pair.getValue().toString())) { result.put(getCacheRowKey(type, pair.getValue().toString().replace("\"", "")), stripTestPrefix(method.getName()), stripCurlyBrackets(method.getBody().toString())); return; } } } } } }
@Override public void visit(final MemberValuePair n, final Object arg) { printJavaComment(n.getComment(), arg); printer.print(n.getName()); printer.print(" = "); n.getValue().accept(this, arg); }
@Override public Node visit(MemberValuePair _n, Object _arg) { Expression value = cloneNodes(_n.getValue(), _arg); Comment comment = cloneNodes(_n.getComment(), _arg); MemberValuePair r = new MemberValuePair( _n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(), _n.getName(), value ); r.setComment(comment); return r; }
boolean changed = false; for (MemberValuePair pair : tagDecl.getPairs()) { if (pair.getName().equals("path")) { pair.setValue(new StringLiteralExpr("bar.gtmpl")); changed = true;
boolean changed = false; for (MemberValuePair pair : tagDecl.getPairs()) { if (pair.getName().equals("path")) { pair.setValue(new StringLiteralExpr("bar.gtmpl")); changed = true;