T - @FunctionalInterface
public interface AnnotationReplacer<T extends java.lang.annotation.Annotation>
This can be exceptionally powerful (and dangerous), as it can create dynamic annotations, whose values are not restricted by static, compile-time known ones.
It also allows building shortcut annotations, as well as configurable values inside annotations.
Register with Lamp.Builder.annotationReplacer(Class, AnnotationReplacer)
| Modifier and Type | Method and Description |
|---|---|
@Nullable java.util.Collection<java.lang.annotation.Annotation> |
replaceAnnotation(@NotNull java.lang.reflect.AnnotatedElement element,
T annotation)
Returns a collection of annotations that will substitute the given annotation,
and be accessible in
AnnotationList.get(Class). |
@Nullable
@Nullable java.util.Collection<java.lang.annotation.Annotation> replaceAnnotation(@NotNull
@NotNull java.lang.reflect.AnnotatedElement element,
@NotNull
T annotation)
AnnotationList.get(Class).element - The element (method, parameter, class, etc.)annotation - The annotation to replace.