public final class Annotations extends Object
Annotation
s.Modifier | Constructor and Description |
---|---|
private |
Annotations() |
Modifier and Type | Method and Description |
---|---|
private static Stream<Class<?>> |
_getAncestorAndSelfInterfaces(Class<?> classToTest) |
private static Stream<Class<?>> |
_getAncestorInterfaces(Class<?> classToTest) |
private static Stream<Class<?>> |
_getSuperclassesAndSelf(Class<?> classToTest) |
private static Stream<Class<?>> |
_getSuperInterfaces(Class<?> classToTest) |
private static boolean |
_isAnnotationPresentOnInterfaces(Class<?> classToTest,
Class<? extends Annotation> annotationClass) |
private static boolean |
_isAnnotationPresentOnInterfacesOfSuperclasses(Class<?> classToTest,
Class<? extends Annotation> annotationClass) |
static boolean |
isAnnotationPresent(Class<?> classToTest,
Class<? extends Annotation> annotationClass)
Tests if given
Annotation is present on any of the superclasses or on any of the implemented interfaces. |
private Annotations()
public static boolean isAnnotationPresent(Class<?> classToTest, Class<? extends Annotation> annotationClass)
Annotation
is present on any of the superclasses or on any of the implemented interfaces.
Class.isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation>)
, it also checks into all the implemented interfaces.
Annotation
must be annotated with Inherited
meta-annotation.classToTest
- The class to testannotationClass
- The Annotation
classtrue
if annotation is present on any of the superclasses or on any of the implemented interfaces.private static boolean _isAnnotationPresentOnInterfacesOfSuperclasses(Class<?> classToTest, Class<? extends Annotation> annotationClass)
private static Stream<Class<?>> _getSuperclassesAndSelf(Class<?> classToTest)
private static boolean _isAnnotationPresentOnInterfaces(Class<?> classToTest, Class<? extends Annotation> annotationClass)
private static Stream<Class<?>> _getAncestorAndSelfInterfaces(Class<?> classToTest)
private static Stream<Class<?>> _getAncestorInterfaces(Class<?> classToTest)
private static Stream<Class<?>> _getSuperInterfaces(Class<?> classToTest)