use of org.gradle.api.internal.tasks.properties.annotations.NoOpPropertyAnnotationHandler in project gradle by gradle.
the class InspectionSchemeFactory method inspectionScheme.
/**
* Creates a new {@link InspectionScheme} with the given annotations enabled and using the given instantiation scheme.
*/
public InspectionScheme inspectionScheme(Collection<Class<? extends Annotation>> annotations, Collection<Class<? extends Annotation>> propertyModifiers, InstantiationScheme instantiationScheme) {
ImmutableList.Builder<PropertyAnnotationHandler> propertyHandlers = ImmutableList.builderWithExpectedSize(annotations.size());
for (Class<? extends Annotation> annotation : annotations) {
PropertyAnnotationHandler propertyHandler = allKnownPropertyHandlers.get(annotation);
if (propertyHandler == null) {
throw new IllegalArgumentException(String.format("@%s is not a registered property type annotation.", annotation.getSimpleName()));
}
propertyHandlers.add(propertyHandler);
}
for (Class<? extends Annotation> annotation : instantiationScheme.getInjectionAnnotations()) {
if (!annotations.contains(annotation)) {
propertyHandlers.add(new NoOpPropertyAnnotationHandler(annotation));
}
}
return new InspectionSchemeImpl(allKnownTypeHandlers, propertyHandlers.build(), propertyModifiers, typeAnnotationMetadataStore, cacheFactory);
}
Aggregations