org.springframework.core.type.classreading

Class MethodMetadataReadingVisitor

    • Field Detail

      • methodName

        protected final java.lang.String methodName
      • access

        protected final int access
      • declaringClassName

        protected final java.lang.String declaringClassName
      • returnTypeName

        protected final java.lang.String returnTypeName
      • classLoader

        @Nullable
        protected final java.lang.ClassLoader classLoader
      • methodMetadataSet

        protected final java.util.Set<MethodMetadata> methodMetadataSet
      • metaAnnotationMap

        protected final java.util.Map<java.lang.String,java.util.Set<java.lang.String>> metaAnnotationMap
    • Constructor Detail

      • MethodMetadataReadingVisitor

        public MethodMetadataReadingVisitor(java.lang.String methodName,
                                            int access,
                                            java.lang.String declaringClassName,
                                            java.lang.String returnTypeName,
                                            @Nullable
                                            java.lang.ClassLoader classLoader,
                                            java.util.Set<MethodMetadata> methodMetadataSet)
    • Method Detail

      • visitAnnotation

        public AnnotationVisitor visitAnnotation(java.lang.String desc,
                                                 boolean visible)
        Description copied from class: MethodVisitor
        Visits an annotation of this method.
        Overrides:
        visitAnnotation in class MethodVisitor
        Parameters:
        desc - the class descriptor of the annotation class.
        visible - true if the annotation is visible at runtime.
        Returns:
        a visitor to visit the annotation values, or null if this visitor is not interested in visiting this annotation.
      • isAbstract

        public boolean isAbstract()
        Description copied from interface: MethodMetadata
        Return whether the underlying method is effectively abstract: i.e. marked as abstract on a class or declared as a regular, non-default method in an interface.
        Specified by:
        isAbstract in interface MethodMetadata
      • isStatic

        public boolean isStatic()
        Description copied from interface: MethodMetadata
        Return whether the underlying method is declared as 'static'.
        Specified by:
        isStatic in interface MethodMetadata
      • isFinal

        public boolean isFinal()
        Description copied from interface: MethodMetadata
        Return whether the underlying method is marked as 'final'.
        Specified by:
        isFinal in interface MethodMetadata
      • isOverridable

        public boolean isOverridable()
        Description copied from interface: MethodMetadata
        Return whether the underlying method is overridable, i.e. not marked as static, final or private.
        Specified by:
        isOverridable in interface MethodMetadata
      • getAnnotationAttributes

        @Nullable
        public AnnotationAttributes getAnnotationAttributes(java.lang.String annotationName)
        Description copied from interface: AnnotatedTypeMetadata
        Retrieve the attributes of the annotation of the given type, if any (i.e. if defined on the underlying element, as direct annotation or meta-annotation), also taking attribute overrides on composed annotations into account.
        Specified by:
        getAnnotationAttributes in interface AnnotatedTypeMetadata
        Parameters:
        annotationName - the fully qualified class name of the annotation type to look for
        Returns:
        a Map of attributes, with the attribute name as key (e.g. "value") and the defined attribute value as Map value. This return value will be null if no matching annotation is defined.
      • getAnnotationAttributes

        @Nullable
        public AnnotationAttributes getAnnotationAttributes(java.lang.String annotationName,
                                                                      boolean classValuesAsString)
        Description copied from interface: AnnotatedTypeMetadata
        Retrieve the attributes of the annotation of the given type, if any (i.e. if defined on the underlying element, as direct annotation or meta-annotation), also taking attribute overrides on composed annotations into account.
        Specified by:
        getAnnotationAttributes in interface AnnotatedTypeMetadata
        Parameters:
        annotationName - the fully qualified class name of the annotation type to look for
        classValuesAsString - whether to convert class references to String class names for exposure as values in the returned Map, instead of Class references which might potentially have to be loaded first
        Returns:
        a Map of attributes, with the attribute name as key (e.g. "value") and the defined attribute value as Map value. This return value will be null if no matching annotation is defined.
      • getAllAnnotationAttributes

        @Nullable
        public MultiValueMap<java.lang.String,java.lang.Object> getAllAnnotationAttributes(java.lang.String annotationName)
        Description copied from interface: AnnotatedTypeMetadata
        Retrieve all attributes of all annotations of the given type, if any (i.e. if defined on the underlying element, as direct annotation or meta-annotation). Note that this variant does not take attribute overrides into account.
        Specified by:
        getAllAnnotationAttributes in interface AnnotatedTypeMetadata
        Parameters:
        annotationName - the fully qualified class name of the annotation type to look for
        Returns:
        a MultiMap of attributes, with the attribute name as key (e.g. "value") and a list of the defined attribute values as Map value. This return value will be null if no matching annotation is defined.
        See Also:
        AnnotatedTypeMetadata.getAllAnnotationAttributes(String, boolean)
      • getAllAnnotationAttributes

        @Nullable
        public MultiValueMap<java.lang.String,java.lang.Object> getAllAnnotationAttributes(java.lang.String annotationName,
                                                                                                     boolean classValuesAsString)
        Description copied from interface: AnnotatedTypeMetadata
        Retrieve all attributes of all annotations of the given type, if any (i.e. if defined on the underlying element, as direct annotation or meta-annotation). Note that this variant does not take attribute overrides into account.
        Specified by:
        getAllAnnotationAttributes in interface AnnotatedTypeMetadata
        Parameters:
        annotationName - the fully qualified class name of the annotation type to look for
        classValuesAsString - whether to convert class references to String
        Returns:
        a MultiMap of attributes, with the attribute name as key (e.g. "value") and a list of the defined attribute values as Map value. This return value will be null if no matching annotation is defined.
        See Also:
        AnnotatedTypeMetadata.getAllAnnotationAttributes(String)
      • getDeclaringClassName

        public java.lang.String getDeclaringClassName()
        Description copied from interface: MethodMetadata
        Return the fully-qualified name of the class that declares this method.
        Specified by:
        getDeclaringClassName in interface MethodMetadata
      • getReturnTypeName

        public java.lang.String getReturnTypeName()
        Description copied from interface: MethodMetadata
        Return the fully-qualified name of this method's declared return type.
        Specified by:
        getReturnTypeName in interface MethodMetadata