Package iu.type

Class AnnotatedElementBase<E extends AnnotatedElement>

java.lang.Object
iu.type.ElementBase
iu.type.AnnotatedElementBase<E>
Type Parameters:
E - annotated element type
All Implemented Interfaces:
IuAnnotatedElement
Direct Known Subclasses:
DeclaredElementBase, ParameterFacade

sealed class AnnotatedElementBase<E extends AnnotatedElement> extends ElementBase implements IuAnnotatedElement permits DeclaredElementBase<D,E>, ParameterFacade<T>
Implements the facade view of an AnnotatedElement.
  • Field Details

    • annotatedElement

      final E extends AnnotatedElement annotatedElement
      Real annotated element viewed via this facade.
  • Constructor Details

    • AnnotatedElementBase

      AnnotatedElementBase(E annotatedElement)
      Default constructor, for use by all subclasses extend TypeTemplate.
      Parameters:
      annotatedElement - real annotated element to provide a view of
    • AnnotatedElementBase

      AnnotatedElementBase(E annotatedElement, Consumer<TypeTemplate<?,?>> preInitHook)
      Constructor for use by TypeTemplate.
      Parameters:
      annotatedElement - real annotated element to provide a view of
      preInitHook - used by TypeFactory
  • Method Details

    • hasAnnotation

      public boolean hasAnnotation(Class<? extends Annotation> annotationType)
      Description copied from interface: IuAnnotatedElement
      Determines if an annotation is present.
      Specified by:
      hasAnnotation in interface IuAnnotatedElement
      Parameters:
      annotationType - annotation type
      Returns:
      true if the annotation is present, else null
    • annotation

      public <A extends Annotation> A annotation(Class<A> annotationType)
      Description copied from interface: IuAnnotatedElement
      Gets an annotation.
      Specified by:
      annotation in interface IuAnnotatedElement
      Type Parameters:
      A - annotation type
      Parameters:
      annotationType - annotation type
      Returns:
      annotation if present, else null
    • annotations

      public Iterable<? extends Annotation> annotations()
      Description copied from interface: IuAnnotatedElement
      Gets all defined annotations.
      Specified by:
      annotations in interface IuAnnotatedElement
      Returns:
      all annotations
    • permitted

      public boolean permitted(Predicate<String> isUserInRole)
      Description copied from interface: IuAnnotatedElement
      Determines if access to this element is permitted in the current context.
      Specified by:
      permitted in interface IuAnnotatedElement
      Parameters:
      isUserInRole - Delegates role-checks to a higher level module.
      Returns:
      true if access is permitted in the current context; else false