Methods Summary |
---|
public void | addContents(DexFile file){@inheritDoc}
super.addContents(file);
StringIdsSection stringIds = file.getStringIds();
stringIds.intern(getRef().getNat().getName());
|
public final com.android.dexgen.rop.cst.CstMemberRef | getRef()Gets the member constant.
return cst;
|
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.
|
protected abstract java.lang.String | getTypoidName()Returns the field name of the type-like thing associated with
this item, for listing-generating purposes. Subclasses must override
this.
|
public int | writeSize(){@inheritDoc}
return WRITE_SIZE;
|
public final void | writeTo(DexFile file, com.android.dexgen.util.AnnotatedOutput out){@inheritDoc}
TypeIdsSection typeIds = file.getTypeIds();
StringIdsSection stringIds = file.getStringIds();
CstNat nat = cst.getNat();
int classIdx = typeIds.indexOf(getDefiningClass());
int nameIdx = stringIds.indexOf(nat.getName());
int typoidIdx = getTypoidIdx(file);
if (out.annotates()) {
out.annotate(0, indexString() + ' " + cst.toHuman());
out.annotate(2, " class_idx: " + Hex.u2(classIdx));
out.annotate(2, String.format(" %-10s %s", getTypoidName() + ':",
Hex.u2(typoidIdx)));
out.annotate(4, " name_idx: " + Hex.u4(nameIdx));
}
out.writeShort(classIdx);
out.writeShort(typoidIdx);
out.writeInt(nameIdx);
|