com.android.dx.dex.file
Class MemberIdItem

java.lang.Object
  extended by com.android.dx.dex.file.Item
      extended by com.android.dx.dex.file.IndexedItem
          extended by com.android.dx.dex.file.IdItem
              extended by com.android.dx.dex.file.MemberIdItem
Direct Known Subclasses:
FieldIdItem, MethodIdItem

public abstract class MemberIdItem
extends IdItem

Representation of a member (field or method) reference inside a Dalvik file.


Constructor Summary
MemberIdItem(CstMemberRef cst)
          Constructs an instance.
 
Method Summary
 void addContents(DexFile file)
          Populates a DexFile with items from within this instance.
 CstMemberRef getRef()
          Gets the member constant.
protected abstract  int getTypoidIdx(DexFile file)
          Returns the index of the type-like thing associated with this item, in order that it may be written out.
protected abstract  String getTypoidName()
          Returns the field name of the type-like thing associated with this item, for listing-generating purposes.
 int writeSize()
          Gets the size of this instance when written, in bytes.
 void writeTo(DexFile file, AnnotatedOutput out)
          Writes the representation of this instance to the given data section, using the given DexFile to look things up as needed.
 
Methods inherited from class com.android.dx.dex.file.IdItem
getDefiningClass
 
Methods inherited from class com.android.dx.dex.file.IndexedItem
getIndex, hasIndex, indexString, setIndex
 
Methods inherited from class com.android.dx.dex.file.Item
itemType, typeName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemberIdItem

public MemberIdItem(CstMemberRef cst)
Constructs an instance.

Parameters:
cst - non-null; the constant for the member
Method Detail

writeSize

public int writeSize()
Gets the size of this instance when written, in bytes.

Specified by:
writeSize in class Item
Returns:
>= 0; the write size

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 IdItem
Parameters:
file - non-null; the file to populate

writeTo

public final void writeTo(DexFile file,
                          AnnotatedOutput out)
Writes the representation of this instance to the given data section, using the given DexFile to look things up as needed. If this instance keeps track of its offset, then this method will note the written offset and will also throw an exception if this instance has already been written.

Specified by:
writeTo in class Item
Parameters:
file - non-null; the file to use for reference
out - non-null; where to write to

getTypoidIdx

protected abstract 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.

Parameters:
file - non-null; the file being written
Returns:
the index in question

getTypoidName

protected abstract String getTypoidName()
Returns the field name of the type-like thing associated with this item, for listing-generating purposes. Subclasses must override this.

Returns:
non-null; the name in question

getRef

public final CstMemberRef getRef()
Gets the member constant.

Returns:
non-null; the constant


Copyright © 2013. All Rights Reserved.