Gets the strategy for an annotation.
(Annotation annotation)
| 346 | |
| 347 | /** Gets the strategy for an annotation. */ |
| 348 | static AnnotationStrategy strategyFor(Annotation annotation) { |
| 349 | checkNotNull(annotation, "annotation"); |
| 350 | Class<? extends Annotation> annotationType = annotation.annotationType(); |
| 351 | ensureRetainedAtRuntime(annotationType); |
| 352 | ensureIsBindingAnnotation(annotationType); |
| 353 | |
| 354 | if (Annotations.isMarker(annotationType)) { |
| 355 | return new AnnotationTypeStrategy(annotationType, annotation); |
| 356 | } |
| 357 | |
| 358 | return new AnnotationInstanceStrategy(Annotations.canonicalizeIfNamed(annotation)); |
| 359 | } |
| 360 | |
| 361 | /** Gets the strategy for an annotation type. */ |
| 362 | static AnnotationStrategy strategyFor(Class<? extends Annotation> annotationType) { |
no test coverage detected