public void removeAnnotation(final JavaType annotationType) { for (final AnnotationMetadataBuilder annotationMetadataBuilder : annotations) { if (annotationMetadataBuilder.getAnnotationType().equals(annotationType)) { annotations.remove(annotationMetadataBuilder); break; } } }
@Override protected void onAddAnnotation(final AnnotationMetadataBuilder md) { Validate.isTrue(governor.getAnnotation(md.getAnnotationType()) == null, "Type annotation '%s' already defined in target type '%s' (ITD target '%s')", md.getAnnotationType(), governor.getName().getFullyQualifiedTypeName(), aspect.getFullyQualifiedTypeName()); Validate.isTrue(build().getAnnotation(md.getAnnotationType()) == null, "Type annotation '%s' already defined in ITD (ITD target '%s')", md.getAnnotationType(), aspect.getFullyQualifiedTypeName()); }
public AnnotationMetadata build() { DefaultAnnotationMetadata annotationMetadata = new DefaultAnnotationMetadata(getAnnotationType(), new ArrayList<AnnotationAttributeValue<?>>(getAttributes().values())); annotationMetadata.setCommentStructure(commentStructure); return annotationMetadata; }
/** * Ensures that the governor is annotated with the given annotation * * @param AnnotationMetadataBuilder the annotation to use(required) * @since 2.0 */ protected final void ensureGovernorIsAnnotated(final AnnotationMetadataBuilder annotationMetadata) { if (governorTypeDetails.getAnnotation(annotationMetadata.getAnnotationType()) == null) { builder.addAnnotation(annotationMetadata); } }
/** * Locates the specified type-level annotation. * * @param type to locate (can be <code>null</code>) * @return the annotation, or null if not found * @since 1.2.0 */ public AnnotationMetadataBuilder getDeclaredTypeAnnotation(final JavaType type) { for (final AnnotationMetadataBuilder annotationBuilder : getAnnotations()) { if (annotationBuilder.getAnnotationType().equals(type)) { return annotationBuilder; } } return null; }
public void removeAnnotation(final JavaType annotationType) { for (final AnnotationMetadataBuilder annotationMetadataBuilder : annotations) { if (annotationMetadataBuilder.getAnnotationType().equals(annotationType)) { annotations.remove(annotationMetadataBuilder); break; } } }
if (targetAnnotation.getAnnotationType().equals(annotation.getAnnotationType())) { continue annotationAdditions;
@Override protected void onAddAnnotation(final AnnotationMetadataBuilder md) { Validate.isTrue(governor.getAnnotation(md.getAnnotationType()) == null, "Type annotation '%s' already defined in target type '%s' (ITD target '%s')", md.getAnnotationType(), governor.getName().getFullyQualifiedTypeName(), aspect.getFullyQualifiedTypeName()); Validate.isTrue(build().getAnnotation(md.getAnnotationType()) == null, "Type annotation '%s' already defined in ITD (ITD target '%s')", md.getAnnotationType(), aspect.getFullyQualifiedTypeName()); }
public AnnotationMetadata build() { DefaultAnnotationMetadata annotationMetadata = new DefaultAnnotationMetadata(getAnnotationType(), new ArrayList<AnnotationAttributeValue<?>>(getAttributes().values())); annotationMetadata.setCommentStructure(commentStructure); return annotationMetadata; }
/** * Ensures that the governor is annotated with the given annotation * * @param AnnotationMetadataBuilder the annotation to use(required) * @since 2.0 */ protected final void ensureGovernorIsAnnotated(final AnnotationMetadataBuilder annotationMetadata) { if (governorTypeDetails.getAnnotation(annotationMetadata.getAnnotationType()) == null) { builder.addAnnotation(annotationMetadata); } }
/** * Locates the specified type-level annotation. * * @param type to locate (can be <code>null</code>) * @return the annotation, or null if not found * @since 1.2.0 */ public AnnotationMetadataBuilder getDeclaredTypeAnnotation(final JavaType type) { for (final AnnotationMetadataBuilder annotationBuilder : getAnnotations()) { if (annotationBuilder.getAnnotationType().equals(type)) { return annotationBuilder; } } return null; }
for (AnnotationMetadata fieldAnnotation : field .getAnnotations()) { if (annotation.getAnnotationType().equals( fieldAnnotation.getAnnotationType())) { annotationFound = true;
if (targetAnnotation.getAnnotationType().equals(annotation.getAnnotationType())) { continue annotationAdditions;