Class RuntimeInlineAnnotationReader

    • Constructor Detail

      • RuntimeInlineAnnotationReader

        public RuntimeInlineAnnotationReader()
    • Method Detail

      • getFieldAnnotation

        public <A extends java.lang.annotation.Annotation> A getFieldAnnotation​(java.lang.Class<A> annotation,
                                                                                java.lang.reflect.Field field,
                                                                                Locatable srcPos)
        Description copied from interface: AnnotationReader
        Reads an annotation on a property that consists of a field.
        Specified by:
        getFieldAnnotation in interface AnnotationReader<java.lang.reflect.Type,​java.lang.Class,​java.lang.reflect.Field,​java.lang.reflect.Method>
      • hasFieldAnnotation

        public boolean hasFieldAnnotation​(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType,
                                          java.lang.reflect.Field field)
        Description copied from interface: AnnotationReader
        Checks if the given field has an annotation.
        Specified by:
        hasFieldAnnotation in interface AnnotationReader<java.lang.reflect.Type,​java.lang.Class,​java.lang.reflect.Field,​java.lang.reflect.Method>
      • hasClassAnnotation

        public boolean hasClassAnnotation​(java.lang.Class clazz,
                                          java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
        Description copied from interface: AnnotationReader
        Checks if a class has the annotation.
        Specified by:
        hasClassAnnotation in interface AnnotationReader<java.lang.reflect.Type,​java.lang.Class,​java.lang.reflect.Field,​java.lang.reflect.Method>
      • getAllFieldAnnotations

        public java.lang.annotation.Annotation[] getAllFieldAnnotations​(java.lang.reflect.Field field,
                                                                        Locatable srcPos)
        Description copied from interface: AnnotationReader
        Gets all the annotations on a field.
        Specified by:
        getAllFieldAnnotations in interface AnnotationReader<java.lang.reflect.Type,​java.lang.Class,​java.lang.reflect.Field,​java.lang.reflect.Method>
      • getMethodAnnotation

        public <A extends java.lang.annotation.Annotation> A getMethodAnnotation​(java.lang.Class<A> annotation,
                                                                                 java.lang.reflect.Method method,
                                                                                 Locatable srcPos)
        Specified by:
        getMethodAnnotation in interface AnnotationReader<java.lang.reflect.Type,​java.lang.Class,​java.lang.reflect.Field,​java.lang.reflect.Method>
      • hasMethodAnnotation

        public boolean hasMethodAnnotation​(java.lang.Class<? extends java.lang.annotation.Annotation> annotation,
                                           java.lang.reflect.Method method)
        Specified by:
        hasMethodAnnotation in interface AnnotationReader<java.lang.reflect.Type,​java.lang.Class,​java.lang.reflect.Field,​java.lang.reflect.Method>
      • getAllMethodAnnotations

        public java.lang.annotation.Annotation[] getAllMethodAnnotations​(java.lang.reflect.Method method,
                                                                         Locatable srcPos)
        Description copied from interface: AnnotationReader
        Gets all the annotations on a method.
        Specified by:
        getAllMethodAnnotations in interface AnnotationReader<java.lang.reflect.Type,​java.lang.Class,​java.lang.reflect.Field,​java.lang.reflect.Method>
        srcPos - the location from which this annotation is read.
      • getMethodParameterAnnotation

        public <A extends java.lang.annotation.Annotation> A getMethodParameterAnnotation​(java.lang.Class<A> annotation,
                                                                                          java.lang.reflect.Method method,
                                                                                          int paramIndex,
                                                                                          Locatable srcPos)
        Description copied from interface: AnnotationReader
        Reads an annotation on a parameter of the method.
        Specified by:
        getMethodParameterAnnotation in interface AnnotationReader<java.lang.reflect.Type,​java.lang.Class,​java.lang.reflect.Field,​java.lang.reflect.Method>
        Returns:
        null if the annotation was not found.
      • getClassAnnotation

        public <A extends java.lang.annotation.Annotation> A getClassAnnotation​(java.lang.Class<A> a,
                                                                                java.lang.Class clazz,
                                                                                Locatable srcPos)
        Description copied from interface: AnnotationReader
        Reads an annotation on a class.
        Specified by:
        getClassAnnotation in interface AnnotationReader<java.lang.reflect.Type,​java.lang.Class,​java.lang.reflect.Field,​java.lang.reflect.Method>
      • getPackageAnnotation

        public <A extends java.lang.annotation.Annotation> A getPackageAnnotation​(java.lang.Class<A> a,
                                                                                  java.lang.Class clazz,
                                                                                  Locatable srcPos)
        Description copied from interface: AnnotationReader
        Reads an annotation on the package that the given class belongs to.
        Specified by:
        getPackageAnnotation in interface AnnotationReader<java.lang.reflect.Type,​java.lang.Class,​java.lang.reflect.Field,​java.lang.reflect.Method>
      • getClassValue

        public java.lang.Class getClassValue​(java.lang.annotation.Annotation a,
                                             java.lang.String name)
        Description copied from interface: AnnotationReader
        Reads a value of an annotation that returns a Class object.

        Depending on the underlying reflection library, you can't always obtain the Class object directly (see the Annotation Processing MirrorTypeException for example), so use this method to avoid that.

        Specified by:
        getClassValue in interface AnnotationReader<java.lang.reflect.Type,​java.lang.Class,​java.lang.reflect.Field,​java.lang.reflect.Method>
        name - The name of the annotation parameter to be read.
      • fullName

        protected java.lang.String fullName​(java.lang.reflect.Method m)
        Description copied from class: AbstractInlineAnnotationReaderImpl
        Gets the fully-qualified name of the method. Used for error messages.
        Specified by:
        fullName in class AbstractInlineAnnotationReaderImpl<java.lang.reflect.Type,​java.lang.Class,​java.lang.reflect.Field,​java.lang.reflect.Method>