void (JAnnotationArrayMember aClass, JAnnotationValue toAdd) { try { Field field = JAnnotationArrayMember.class.getDeclaredField("values"); field.setAccessible(true); @SuppressWarnings("unchecked") List<JAnnotationValue> annotations = (List<JAnnotationValue>)field.get(aClass); annotations.add(toAdd); } catch (NoSuchFieldException e) { throw new GenerationException(e); } catch (IllegalAccessException e) { throw new GenerationException(e); } }