void renameClass(Map classnames) { Renamer renamer = new Renamer(info, getConstPool(), classnames); try { renamer.annotationArray(); } catch (Exception e) { throw new RuntimeException(e); } }
@Override void renameClass(Map<String,String> classnames) { Renamer renamer = new Renamer(info, getConstPool(), classnames); try { renamer.annotationArray(); } catch (Exception e) { throw new RuntimeException(e); } }
void renameClass(Map classnames) { Renamer renamer = new Renamer(info, getConstPool(), classnames); try { renamer.annotationArray(); } catch (Exception e) { throw new RuntimeException(e); } }
void renameClass(Map classnames) { Renamer renamer = new Renamer(info, getConstPool(), classnames); try { renamer.annotationArray(); } catch (Exception e) { throw new RuntimeException(e); } }
void renameClass(Map classnames) { Renamer renamer = new Renamer(info, getConstPool(), classnames); try { renamer.annotationArray(); } catch (Exception e) { throw new RuntimeException(e); } }
/** * Create a new annotation to be dynamically inserted in the byte code. */ static void createAnnotation(AnnotationsAttribute attribute, Class<? extends java.lang.annotation.Annotation> annotationType, Map<String, MemberValue> members) { Annotation annotation = new Annotation(annotationType.getName(), attribute.getConstPool()); for (Map.Entry<String, MemberValue> member : members.entrySet()) { annotation.addMemberValue(member.getKey(), member.getValue()); } attribute.addAnnotation(annotation); }
void renameClass(Map classnames) { Renamer renamer = new Renamer(info, getConstPool(), classnames); try { renamer.annotationArray(); } catch (Exception e) { throw new RuntimeException(e); } }
public static void createAnnotation(AnnotationsAttribute attribute, Class<? extends Annotation> annotationType, Map<String, MemberValue> members) { javassist.bytecode.annotation.Annotation annotation = new javassist.bytecode.annotation.Annotation(annotationType.getName(), attribute.getConstPool()); for (Map.Entry<String, MemberValue> member : members.entrySet()) { annotation.addMemberValue(member.getKey(), member.getValue()); } attribute.addAnnotation(annotation); }
/** * Create a new annotation to be dynamically inserted in the byte code. */ static void createAnnotation(AnnotationsAttribute attribute, Class<? extends java.lang.annotation.Annotation> annotationType, Map<String, MemberValue> members) { Annotation annotation = new Annotation(annotationType.getName(), attribute.getConstPool()); for (Map.Entry<String, MemberValue> member : members.entrySet()) { annotation.addMemberValue(member.getKey(), member.getValue()); } attribute.addAnnotation(annotation); }
@SuppressWarnings("PMD.UnusedPrivateMethod") private static void applyScopeAnnotation(final ClassPool classPool, final AnnotationsAttribute annotations, final AnnotatedElement source, final Class<? extends java.lang.annotation.Annotation> scope) throws Exception { if (scope != null) { Preconditions.checkState(Annotations.isScopeAnnotation(scope), "Provided annotation %s is not scope annotation", scope.getSimpleName()); for (java.lang.annotation.Annotation ann : source.getAnnotations()) { Preconditions.checkArgument(!(ann instanceof ScopeAnnotation), "Duplicate scope definition: scope is specified as %s and also defined " + "in @ScopeAnnotation.", scope.getSimpleName()); } annotations.addAnnotation(new Annotation(annotations.getConstPool(), classPool.get(scope.getName()))); } }
/** * Create a new annotation to be dynamically inserted in the byte code. * * @param attribute * annotation attribute * @param annotationType * Annotation * @param members * Member of the annotation */ protected static void createAnnotation(AnnotationsAttribute attribute, Class<? extends Annotation> annotationType, Map<String, MemberValue> members) { javassist.bytecode.annotation.Annotation annotation = new javassist.bytecode.annotation.Annotation(annotationType.getName(), attribute.getConstPool()); for (Map.Entry<String, MemberValue> member : members.entrySet()) { annotation.addMemberValue(member.getKey(), member.getValue()); } attribute.addAnnotation(annotation); }
javassist.bytecode.annotation.Annotation annotation = new javassist.bytecode.annotation.Annotation(annotationType.getName(), attr.getConstPool());
javassist.bytecode.annotation.Annotation annotation = new javassist.bytecode.annotation.Annotation(annotationType.getName(), attr.getConstPool());
private static void addQueryAnnotation(CtMethod ctMethod, String sql) { AnnotationsAttribute attribute = (AnnotationsAttribute) ctMethod.getMethodInfo().getAttribute(AnnotationsAttribute.visibleTag); ConstPool constPool = attribute.getConstPool(); Annotation annotation = new Annotation(ctMethod.getName().startsWith("delete") ? "org.apache.ibatis.annotations.Delete" : "org.apache.ibatis.annotations.Select", constPool); ArrayMemberValue memberValue = new ArrayMemberValue(new StringMemberValue(constPool), constPool); memberValue.setValue(new MemberValue[]{new StringMemberValue(sql, constPool)}); annotation.addMemberValue("value", memberValue); attribute.addAnnotation(annotation); }