Class AnnotatedElementImpl

java.lang.Object
org.glassfish.hk2.classmodel.reflect.impl.AnnotatedElementImpl
All Implemented Interfaces:
AnnotatedElement
Direct Known Subclasses:
FieldModelImpl, MethodModelImpl, TypeImpl

public class AnnotatedElementImpl extends Object implements AnnotatedElement
Implementation of an annotated element
  • Field Details

    • name

      private final String name
    • annotations

      private final List<AnnotationModel> annotations
    • isApplicationClass

      private boolean isApplicationClass
  • Constructor Details

    • AnnotatedElementImpl

      public AnnotatedElementImpl(String name)
  • Method Details

    • getName

      public String getName()
      Description copied from interface: AnnotatedElement
      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 from Class.getName()
      Specified by:
      getName in interface AnnotatedElement
      Returns:
      the annotated element name
    • addAnnotation

      void addAnnotation(AnnotationModel annotation)
    • getAnnotations

      public Collection<AnnotationModel> getAnnotations()
      Description copied from interface: AnnotatedElement
      Returns a unmodifiable set of annotations that are present on this annotated element.
      Specified by:
      getAnnotations in interface AnnotatedElement
      Returns:
      the collection of annotations
    • getAnnotation

      public AnnotationModel getAnnotation(String name)
      Description copied from interface: AnnotatedElement
      Returns an annotation model if the type is annotated with the passed annotation name
      Specified by:
      getAnnotation in interface AnnotatedElement
      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.
    • isApplicationClass

      public boolean isApplicationClass()
    • setApplicationClass

      public void setApplicationClass(boolean applicationClass)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • shortDesc

      public String shortDesc()
      Description copied from interface: AnnotatedElement
      Construct and return a short description name that can be used to display the instance value
      Specified by:
      shortDesc in interface AnnotatedElement
      Returns:
      a short description
    • print

      protected void print(StringBuffer sb)