Class Parameter

  • All Implemented Interfaces:
    java.lang.reflect.AnnotatedElement

    public class Parameter
    extends java.lang.Object
    implements java.lang.reflect.AnnotatedElement
    This class can be replaceable by java.lang.reflect.Parameter if using jdk 1.8.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.annotation.Annotation[] declaredAnnotations
      preserving the order of annotations.
      private java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,​java.lang.annotation.Annotation> declaredAnnotationsMap
      For efficient back to back searches.
      private int index  
      private java.lang.Class<?> type  
    • Constructor Summary

      Constructors 
      Constructor Description
      Parameter​(int index, java.lang.Class<?> type, java.lang.annotation.Annotation[] declaredAnnotations)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,​java.lang.annotation.Annotation> declaredAnnotations​(java.lang.annotation.Annotation[] ann)  
      <T extends java.lang.annotation.Annotation>
      T
      getAnnotation​(java.lang.Class<T> annotationClass)
      java.lang.annotation.Annotation[] getAnnotations()
      java.lang.annotation.Annotation[] getDeclaredAnnotations()
      java.lang.Class<?> getType()
      Returns a Class object that identifies the declared type for the parameter represented by this Parameter object.
      boolean isAnnotationPresent​(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.reflect.AnnotatedElement

        getAnnotationsByType, getDeclaredAnnotation, getDeclaredAnnotationsByType
    • Field Detail

      • index

        private final int index
      • type

        private final java.lang.Class<?> type
      • declaredAnnotations

        private final java.lang.annotation.Annotation[] declaredAnnotations
        preserving the order of annotations.
      • declaredAnnotationsMap

        private final java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,​java.lang.annotation.Annotation> declaredAnnotationsMap
        For efficient back to back searches.
    • Constructor Detail

      • Parameter

        public Parameter​(int index,
                         java.lang.Class<?> type,
                         java.lang.annotation.Annotation[] declaredAnnotations)
    • Method Detail

      • declaredAnnotations

        private static java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,​java.lang.annotation.Annotation> declaredAnnotations​(java.lang.annotation.Annotation[] ann)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getType

        public java.lang.Class<?> getType()
        Returns a Class object that identifies the declared type for the parameter represented by this Parameter object.
        Returns:
        a Class object identifying the declared type of the parameter represented by this object
      • isAnnotationPresent

        public boolean isAnnotationPresent​(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
        Specified by:
        isAnnotationPresent in interface java.lang.reflect.AnnotatedElement
      • getAnnotation

        public <T extends java.lang.annotation.Annotation> T getAnnotation​(java.lang.Class<T> annotationClass)
        Specified by:
        getAnnotation in interface java.lang.reflect.AnnotatedElement
      • getAnnotations

        public java.lang.annotation.Annotation[] getAnnotations()
        Specified by:
        getAnnotations in interface java.lang.reflect.AnnotatedElement
      • getDeclaredAnnotations

        public java.lang.annotation.Annotation[] getDeclaredAnnotations()
        Specified by:
        getDeclaredAnnotations in interface java.lang.reflect.AnnotatedElement