Examples of changeClassAnnotation()


Examples of org.fakereplace.replacement.notification.ChangedClassImpl.changeClassAnnotation()

        if (annotations == null) {
            Annotation[] ans = new Annotation[0];
            classAnnotations.put(clazz, ans);
            classAnnotationsByType.put(clazz, Collections.EMPTY_MAP);
            for(Annotation annotation : clazz.getDeclaredAnnotations()) {
                changedClass.changeClassAnnotation(new ChangedAnnotationImpl(null, annotation, ChangeType.REMOVE, changedClass, annotation.annotationType()));
            }
        } else {
            final Class<?> pclass = createAnnotationsProxy(clazz.getClassLoader(), annotations);
            classAnnotations.put(clazz, pclass.getAnnotations());
            Map<Class<? extends Annotation>, Annotation> anVals = new HashMap<Class<? extends Annotation>, Annotation>();
View Full Code Here

Examples of org.fakereplace.replacement.notification.ChangedClassImpl.changeClassAnnotation()

            final Set<Class<? extends Annotation>> newAnnotations = new HashSet<Class<? extends Annotation>>(anVals.keySet());
            for(Annotation annotation : clazz.getDeclaredAnnotations()) {
                final Annotation newAnnotation = anVals.get(annotation.annotationType());
                if(newAnnotation == null) {
                    //the annotation was removed
                    changedClass.changeClassAnnotation(new ChangedAnnotationImpl(null, annotation, ChangeType.REMOVE, changedClass, annotation.annotationType()));
                } else if(!newAnnotation.equals(annotation)) {
                    //same annotation, but it has been modified
                    changedClass.changeClassAnnotation(new ChangedAnnotationImpl(newAnnotation, annotation, ChangeType.MODIFY, changedClass, annotation.annotationType()));
                }
                newAnnotations.remove(annotation.annotationType());
View Full Code Here

Examples of org.fakereplace.replacement.notification.ChangedClassImpl.changeClassAnnotation()

                if(newAnnotation == null) {
                    //the annotation was removed
                    changedClass.changeClassAnnotation(new ChangedAnnotationImpl(null, annotation, ChangeType.REMOVE, changedClass, annotation.annotationType()));
                } else if(!newAnnotation.equals(annotation)) {
                    //same annotation, but it has been modified
                    changedClass.changeClassAnnotation(new ChangedAnnotationImpl(newAnnotation, annotation, ChangeType.MODIFY, changedClass, annotation.annotationType()));
                }
                newAnnotations.remove(annotation.annotationType());
            }
            for(final Class<? extends Annotation> newAnnotationType : newAnnotations) {
                final Annotation newAnnotation = anVals.get(newAnnotationType);
View Full Code Here

Examples of org.fakereplace.replacement.notification.ChangedClassImpl.changeClassAnnotation()

                }
                newAnnotations.remove(annotation.annotationType());
            }
            for(final Class<? extends Annotation> newAnnotationType : newAnnotations) {
                final Annotation newAnnotation = anVals.get(newAnnotationType);
                changedClass.changeClassAnnotation(new ChangedAnnotationImpl(newAnnotation, null, ChangeType.ADD, changedClass, newAnnotationType));
            }
        }
    }

    public static void recordFieldAnnotations(Field field, AnnotationsAttribute annotations) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.