public class AnnotationUtils extends Object
Helper methods for reading/getting AnnotationNode instances.
Type Params | Return Type | Name and description |
---|---|---|
|
public static List<AnnotationNode> |
getAnnotationNodeInHierarchyWithMetaAnnotation(ClassNode type, ClassNode anno) Gets the next AnnotationNode instance in the inheritance line which is annotated with the given Annotation class anno. |
|
public static List<AnnotationNode> |
getAnnotationNodeInHierarchyWithMetaAnnotation(ClassNode type, MethodNode originMethodNode, ClassNode metaAnnotationClassNode) |
|
public static boolean |
hasAnnotationOfType(AnnotatedNode annotatedNode, String typeOrPackageName) Checks whether the given ClassNode is annotated with an annotations of the given package or full annotatedNode name. |
|
public static List<AnnotationNode> |
hasMetaAnnotations(AnnotatedNode annotatedNode, String metaAnnotationClassName) Loads all annotation nodes of the given AnnotatedNode instance which are marked with the annotation metaAnnotationClassName. |
Gets the next AnnotationNode instance in the inheritance line which is annotated with the given Annotation class anno.
type
- the ClassNode to check for the annotationanno
- the annotation to watch out for
Checks whether there exists a MethodNode up the inheritance tree where exists an annotation which is annotated with metaAnnotationClassNode.
type
- the origin ClassNodeoriginMethodNode
- the origin MethodNodemetaAnnotationClassNode
- the ClassNode of the meta-annotationChecks whether the given ClassNode is annotated with an annotations of the given package or full annotatedNode name.
annotatedNode
- the AnnotatedNode to search for the given annotationtypeOrPackageName
- can either be a part of the package or the complete annotation class nameLoads all annotation nodes of the given AnnotatedNode instance which are marked with the annotation metaAnnotationClassName.
annotatedNode
- an AnnotatedNode from which the annotations are checkedmetaAnnotationClassName
- the name of the meta annotation