Module org.glassfish.hk2.classmodel
Interface AnnotatedElement
- All Known Subinterfaces:
AnnotationType,ClassModel,EnumType,ExtensibleType<T>,FieldModel,InterfaceModel,MethodModel,Parameter,Type
- All Known Implementing Classes:
AnnotatedElementImpl,AnnotationTypeImpl,ClassModelImpl,EnumTypeImpl,ExtensibleTypeImpl,FieldModelImpl,InterfaceModelImpl,MethodModelImpl,ParameterImpl,TypeImpl
public interface AnnotatedElement
An annotated element is a java declaration that can be annotated. Such
declaration are usually types (like classes or interfaces), fields of
a class, or methods of a class.
An annotated element is defined by its name and the set of annotations
present on the declaration.
- Author:
- Jerome Dochez
-
Method Summary
Modifier and TypeMethodDescriptiongetAnnotation(String name) Returns an annotation model if the type is annotated with the passed annotation nameReturns a unmodifiable set of annotations that are present on this annotated element.getName()Annotated element have a name, which vary depending on the actual subclass type.Construct and return a short description name that can be used to display the instance value
-
Method Details
-
getName
String getName()Annotated element have a name, which vary depending on the actual subclass type. For instance, a class annotated element's name is the class name as obtained fromClass.getName()- Returns:
- the annotated element name
-
shortDesc
String shortDesc()Construct and return a short description name that can be used to display the instance value- Returns:
- a short description
-
getAnnotations
Collection<AnnotationModel> getAnnotations()Returns a unmodifiable set of annotations that are present on this annotated element.- Returns:
- the collection of annotations
-
getAnnotation
Returns an annotation model if the type is annotated with the passed annotation name- Parameters:
name- the annotation name- Returns:
- the annotation model or null if the type is not annotated with this annotation type of the passed name.
-