类 MemberFinder

  • 所有已实现的接口:
    MemberVisitor

    public class MemberFinder
    extends java.lang.Object
    implements MemberVisitor
    This utility class provides methods to find class members in a given class or in its hierarchy.
    • 构造器概要

      构造器 
      构造器 说明
      MemberFinder()
      Creates a new MemberFinder that looks in the class hierarchy.
      MemberFinder​(boolean searchHierarchy)
      Creates a new MemberFinder that looks in the class hierarchy if specified.
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      Clazz correspondingClass()
      Returns the corresponding class of the most recently found class member.
      Field findField​(Clazz clazz, java.lang.String name, java.lang.String descriptor)
      Finds the field with the given name and descriptor in the given class or its hierarchy.
      Field findField​(Clazz referencingClass, Clazz clazz, java.lang.String name, java.lang.String descriptor)
      Finds the field with the given name and descriptor in the given class or its hierarchy.
      Member findMember​(Clazz clazz, java.lang.String name, java.lang.String descriptor, boolean isField)
      Finds the class member with the given name and descriptor in the given class or its hierarchy.
      Member findMember​(Clazz referencingClass, Clazz clazz, java.lang.String name, java.lang.String descriptor, boolean isField)
      Finds the class member with the given name and descriptor in the given class or its hierarchy, referenced from the optional given class.
      Method findMethod​(Clazz clazz, java.lang.String name, java.lang.String descriptor)
      Finds the method with the given name and descriptor in the given class or its hierarchy.
      Method findMethod​(Clazz referencingClass, Clazz clazz, java.lang.String name, java.lang.String descriptor)
      Finds the method with the given name and descriptor in the given class or its hierarchy.
      boolean isOverriden​(Clazz clazz, Method method)
      Returns whether the given method is overridden anywhere down the class hierarchy.
      boolean isShadowed​(Clazz clazz, Field field)
      Returns whether the given field is shadowed anywhere down the class hierarchy.
      void visitAnyMember​(Clazz clazz, Member member)
      Visits any Member instance.
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • MemberFinder

        public MemberFinder()
        Creates a new MemberFinder that looks in the class hierarchy.
      • MemberFinder

        public MemberFinder​(boolean searchHierarchy)
        Creates a new MemberFinder that looks in the class hierarchy if specified.
    • 方法详细资料

      • findField

        public Field findField​(Clazz clazz,
                               java.lang.String name,
                               java.lang.String descriptor)
        Finds the field with the given name and descriptor in the given class or its hierarchy. The name and descriptor may contain wildcards.
      • findField

        public Field findField​(Clazz referencingClass,
                               Clazz clazz,
                               java.lang.String name,
                               java.lang.String descriptor)
        Finds the field with the given name and descriptor in the given class or its hierarchy. The name and descriptor may contain wildcards.
      • findMethod

        public Method findMethod​(Clazz clazz,
                                 java.lang.String name,
                                 java.lang.String descriptor)
        Finds the method with the given name and descriptor in the given class or its hierarchy. The name and descriptor may contain wildcards.
      • findMethod

        public Method findMethod​(Clazz referencingClass,
                                 Clazz clazz,
                                 java.lang.String name,
                                 java.lang.String descriptor)
        Finds the method with the given name and descriptor in the given class or its hierarchy. The name and descriptor may contain wildcards.
      • findMember

        public Member findMember​(Clazz clazz,
                                 java.lang.String name,
                                 java.lang.String descriptor,
                                 boolean isField)
        Finds the class member with the given name and descriptor in the given class or its hierarchy. The name and descriptor may contain wildcards.
      • findMember

        public Member findMember​(Clazz referencingClass,
                                 Clazz clazz,
                                 java.lang.String name,
                                 java.lang.String descriptor,
                                 boolean isField)
        Finds the class member with the given name and descriptor in the given class or its hierarchy, referenced from the optional given class. The name and descriptor may contain wildcards.
      • correspondingClass

        public Clazz correspondingClass()
        Returns the corresponding class of the most recently found class member.
      • isOverriden

        public boolean isOverriden​(Clazz clazz,
                                   Method method)
        Returns whether the given method is overridden anywhere down the class hierarchy.
      • isShadowed

        public boolean isShadowed​(Clazz clazz,
                                  Field field)
        Returns whether the given field is shadowed anywhere down the class hierarchy.
      • visitAnyMember

        public void visitAnyMember​(Clazz clazz,
                                   Member member)
        从接口复制的说明: MemberVisitor
        Visits any Member instance. The more specific default implementations of this interface delegate to this method.
        指定者:
        visitAnyMember 在接口中 MemberVisitor