Community
Participate
Working Groups
consider the following template code: for (int idx = 0; idx < enums.size(); idx++) { ctx.putAttribute(part, genConstructorOptions, enums.get(idx).getValue() == 0 ? Integer.valueOf(idx + 1) : Integer.valueOf(enums.get(idx).getValue()) ); ctx.invoke(genInstantiation, (Type)part, ctx, out); out.println(";"); } Each putAttribute creates a new annotation and there is no way to retrieve the new annotation. putAttribute should first try to get the annotation and update it. If the annotation doesn't exist a new should be created.
if the annotation exists it will be updated.
verified