예제 #1
0
 /**
  * Handles the writing of a single annotation to an annotation visitor.
  *
  * @param annotationVisitor The annotation visitor the write process is to be applied on.
  * @param annotation The annotation to be written.
  * @param annotationValueFilter The value filter to apply for discovering which values of an
  *     annotation should be written.
  */
 private static void handle(
     AnnotationVisitor annotationVisitor,
     AnnotationDescription annotation,
     AnnotationValueFilter annotationValueFilter) {
   for (MethodDescription.InDefinedShape methodDescription :
       annotation.getAnnotationType().getDeclaredMethods()) {
     if (annotationValueFilter.isRelevant(annotation, methodDescription)) {
       apply(
           annotationVisitor,
           methodDescription.getReturnType().asErasure(),
           methodDescription.getName(),
           annotation.getValue(methodDescription));
     }
   }
   annotationVisitor.visitEnd();
 }
예제 #2
0
 @Override
 protected Resolution rebase(MethodDescription.InDefinedShape methodDescription) {
   return methodDescription.isConstructor()
       ? Resolution.ForRebasedConstructor.of(
           methodDescription, placeholderType.getTypeDescription())
       : Resolution.ForRebasedMethod.of(methodDescription, methodNameTransformer);
 }
예제 #3
0
 @Override
 protected Resolution rebase(MethodDescription.InDefinedShape methodDescription) {
   if (methodDescription.isConstructor()) {
     throw new IllegalArgumentException("Cannot rebase constructor without preparation");
   }
   return Resolution.ForRebasedMethod.of(methodDescription, methodNameTransformer);
 }
예제 #4
0
 @Override
 public int hashCode() {
   return methodDescription.hashCode();
 }
예제 #5
0
 @Override
 public boolean equals(Object other) {
   return this == other
       || !(other == null || getClass() != other.getClass())
           && methodDescription.equals(((ForRebasedConstructor) other).methodDescription);
 }
예제 #6
0
 @Override
 public boolean equals(Object other) {
   return this == other
       || !(other == null || getClass() != other.getClass())
           && methodDescription.equals(((Preserved) other).methodDescription);
 }