Class DexBackedFieldReference

All Implemented Interfaces:
Comparable<FieldReference>, FieldReference, Reference

public class DexBackedFieldReference extends BaseFieldReference
  • Field Details

    • dexFile

      @Nonnull public final DexBackedDexFile dexFile
    • fieldIndex

      private final int fieldIndex
  • Constructor Details

    • DexBackedFieldReference

      public DexBackedFieldReference(@Nonnull DexBackedDexFile dexFile, int fieldIndex)
  • Method Details

    • getDefiningClass

      @Nonnull public String getDefiningClass()
      Description copied from interface: FieldReference
      Gets the type of the class that defines the referenced field.
      Returns:
      The type of the class that defines the referenced field
    • getName

      @Nonnull public String getName()
      Description copied from interface: FieldReference
      Gets the name of the referenced field.
      Returns:
      The name of the referenced field
    • getType

      @Nonnull public String getType()
      Description copied from interface: FieldReference
      Gets the type of the referenced field.
      Returns:
      The type of the referenced field
    • getSize

      public int getSize()
      Calculate and return the private size of a field reference. Calculated as: class_idx + type_idx + name_idx
      Returns:
      size in bytes
    • validateReference

      public void validateReference() throws Reference.InvalidReferenceException
      Description copied from interface: Reference
      Verifies that this reference is valid.
      Specified by:
      validateReference in interface Reference
      Overrides:
      validateReference in class BaseReference
      Throws:
      Reference.InvalidReferenceException - If the reference is not valid.