String stub = "@" + getName() + "(" + name + "= 0 ) public class Stub { }";
JavaClass<?> temp = Roaster.parse(JavaClass.class, stub);
NormalAnnotation anno = (NormalAnnotation) temp.getAnnotations().get(0).getInternal();
MemberValuePair mvp = (MemberValuePair) anno.values().get(0);
@SuppressWarnings("unchecked")
List<MemberValuePair> values = ((NormalAnnotation) annotation).values();
ListIterator<MemberValuePair> iter = values.listIterator();
while (iter.hasNext())
{
if (iter.next().getName().getIdentifier().equals(name))
{
iter.remove();
break;
}
}
MemberValuePair mvpCopy = (MemberValuePair) ASTNode.copySubtree(annotation.getAST(), mvp);
mvpCopy.setValue((Expression) result.getInternal());
iter.add(mvpCopy);
return result;
}