public final class AnnotatedClassFinder extends Object
Constructor and Description |
---|
AnnotatedClassFinder(Class<? extends Annotation> annotationType)
Create a new instance with the
annotationType to find. |
Modifier and Type | Method and Description |
---|---|
Class<?> |
findFromClass(Class<?> source)
Find the first
Class that is annotated with the target annotation, starting
from the package defined by the given source up to the root. |
Class<?> |
findFromPackage(String source)
Find the first
Class that is annotated with the target annotation, starting
from the package defined by the given source up to the root. |
public AnnotatedClassFinder(Class<? extends Annotation> annotationType)
annotationType
to find.annotationType
- the annotation to findpublic Class<?> findFromClass(Class<?> source)
Class
that is annotated with the target annotation, starting
from the package defined by the given source
up to the root.source
- the source class to use to initiate the searchClass
annotated with the target annotation within the
hierarchy defined by the given source
or null
if none is found.public Class<?> findFromPackage(String source)
Class
that is annotated with the target annotation, starting
from the package defined by the given source
up to the root.source
- the source package to use to initiate the searchClass
annotated with the target annotation within the
hierarchy defined by the given source
or null
if none is found.