Class FieldIdItem


public final class FieldIdItem extends MemberIdItem
Representation of a field reference inside a Dalvik file.
  • Constructor Details

    • FieldIdItem

      public FieldIdItem(CstFieldRef field)
      Constructs an instance.
      Parameters:
      field - non-null; the constant for the field
  • Method Details

    • itemType

      public ItemType itemType()
      Returns the item type for this instance.
      Specified by:
      itemType in class Item
      Returns:
      non-null; the item type
    • addContents

      public void addContents(DexFile file)
      Populates a DexFile with items from within this instance. This will not add an item to the file for this instance itself (which should have been done by whatever refers to this instance).

      Note: Subclasses must override this to do something appropriate.

      Overrides:
      addContents in class MemberIdItem
      Parameters:
      file - non-null; the file to populate
    • getFieldRef

      public CstFieldRef getFieldRef()
      Gets the field constant.
      Returns:
      non-null; the constant
    • getTypoidIdx

      protected int getTypoidIdx(DexFile file)
      Returns the index of the type-like thing associated with this item, in order that it may be written out. Subclasses must override this to get whatever it is they need to store.
      Specified by:
      getTypoidIdx in class MemberIdItem
      Parameters:
      file - non-null; the file being written
      Returns:
      the index in question
    • getTypoidName

      protected String getTypoidName()
      Returns the field name of the type-like thing associated with this item, for listing-generating purposes. Subclasses must override this.
      Specified by:
      getTypoidName in class MemberIdItem
      Returns:
      non-null; the name in question