uk.autores.processors.AnnotationDef Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of annotations Show documentation
Show all versions of annotations Show documentation
Annotation driven library for handling embedded resources
// Copyright 2024 https://github.com/autores-uk/autores/blob/main/LICENSE.txt
// SPDX-License-Identifier: Apache-2.0
package uk.autores.processors;
import javax.annotation.processing.ProcessingEnvironment;
import java.lang.annotation.Annotation;
import java.util.stream.Stream;
final class AnnotationDef {
final Class single;
final Class repeating;
final F factory;
public AnnotationDef(Class single, Class repeating, F factory) {
this.single = single;
this.repeating = repeating;
this.factory = factory;
}
Stream> annotations() {
return Stream.of(single, repeating);
}
@FunctionalInterface
interface F {
ContextFactory create(ProcessingEnvironment env);
}
}