MCPcopy Index your code
hub / github.com/google/guice / strategyFor

Method strategyFor

core/src/com/google/inject/Key.java:348–359  ·  view source on GitHub ↗

Gets the strategy for an annotation.

(Annotation annotation)

Source from the content-addressed store, hash-verified

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) {

Callers 3

KeyMethod · 0.95
getMethod · 0.95
withAnnotationMethod · 0.95

Calls 8

isMarkerMethod · 0.95
canonicalizeIfNamedMethod · 0.95
checkNotNullMethod · 0.80
isAllDefaultMethodsMethod · 0.80
generateAnnotationMethod · 0.80
annotationTypeMethod · 0.45

Tested by

no test coverage detected