proguard.classfile.util
Class MemberFinder

java.lang.Object
  extended by proguard.classfile.util.SimplifiedVisitor
      extended by proguard.classfile.util.MemberFinder
All Implemented Interfaces:
MemberVisitor

public class MemberFinder
extends SimplifiedVisitor
implements MemberVisitor

This class provides methods to find class members in a given class or in its hierarchy.


Constructor Summary
MemberFinder()
           
 
Method Summary
 Clazz correspondingClass()
          Returns the corresponding class of the most recently found class member.
 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 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.
 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 type of class member of the given class.
 
Methods inherited from class proguard.classfile.util.SimplifiedVisitor
visitAnnotation, visitAnnotation, visitAnnotation, visitAnnotation, visitAnnotation, visitAnnotationDefaultAttribute, visitAnnotationElementValue, visitAnyAnnotationsAttribute, visitAnyAttribute, visitAnyClass, visitAnyConstant, visitAnyElementValue, visitAnyInstruction, visitAnyMethodrefConstant, visitAnyParameterAnnotationsAttribute, visitAnyRefConstant, visitAnyStackMapFrame, visitAnySwitchInstruction, visitAnyVerificationType, visitArrayElementValue, visitBranchInstruction, visitClassConstant, visitClassElementValue, visitCodeAttribute, visitConstantElementValue, visitConstantInstruction, visitConstantValueAttribute, visitDeprecatedAttribute, visitDeprecatedAttribute, visitDeprecatedAttribute, visitDeprecatedAttribute, visitDoubleConstant, visitDoubleType, visitEnclosingMethodAttribute, visitEnumConstantElementValue, visitExceptionsAttribute, visitFieldrefConstant, visitFloatConstant, visitFloatType, visitFullFrame, visitInnerClassesAttribute, visitIntegerConstant, visitIntegerType, visitInterfaceMethodrefConstant, visitLessZeroFrame, visitLibraryClass, visitLibraryField, visitLibraryMember, visitLibraryMethod, visitLineNumberTableAttribute, visitLocalVariableTableAttribute, visitLocalVariableTypeTableAttribute, visitLongConstant, visitLongType, visitLookUpSwitchInstruction, visitMethodrefConstant, visitMoreZeroFrame, visitNameAndTypeConstant, visitNullType, visitObjectType, visitProgramClass, visitProgramField, visitProgramMember, visitProgramMethod, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleParameterAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleParameterAnnotationsAttribute, visitSameOneFrame, visitSameZeroFrame, visitSignatureAttribute, visitSignatureAttribute, visitSignatureAttribute, visitSignatureAttribute, visitSimpleInstruction, visitSourceDirAttribute, visitSourceFileAttribute, visitStackDoubleType, visitStackFloatType, visitStackIntegerType, visitStackLongType, visitStackMapAttribute, visitStackMapTableAttribute, visitStackNullType, visitStackObjectType, visitStackTopType, visitStackUninitializedThisType, visitStackUninitializedType, visitStringConstant, visitSyntheticAttribute, visitSyntheticAttribute, visitSyntheticAttribute, visitSyntheticAttribute, visitTableSwitchInstruction, visitTopType, visitUninitializedThisType, visitUninitializedType, visitUnknownAttribute, visitUtf8Constant, visitVariableInstruction, visitVariablesDoubleType, visitVariablesFloatType, visitVariablesIntegerType, visitVariablesLongType, visitVariablesNullType, visitVariablesObjectType, visitVariablesTopType, visitVariablesUninitializedThisType, visitVariablesUninitializedType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface proguard.classfile.visitor.MemberVisitor
visitLibraryField, visitLibraryMethod, visitProgramField, visitProgramMethod
 

Constructor Detail

MemberFinder

public MemberFinder()
Method Detail

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.


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.


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.


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)
Description copied from class: SimplifiedVisitor
Visits any type of class member of the given class.

Overrides:
visitAnyMember in class SimplifiedVisitor