Rename Section to SectionAnnotator

This commit is contained in:
Ben Gruver 2013-02-24 16:22:08 -08:00
parent 85fa15193d
commit df443569f2
5 changed files with 12 additions and 12 deletions

View File

@ -257,13 +257,13 @@ public abstract class DexBackedDexFile extends BaseDexBuffer implements DexFile
public void dumpTo(Writer out, int width) throws IOException {
AnnotatedBytes annotatedBytes = new AnnotatedBytes(width);
HeaderItem.getSection().annotateSection(annotatedBytes, this, 1);
HeaderItem.getAnnotator().annotateSection(annotatedBytes, this, 1);
annotatedBytes.annotate(0, " ");
StringIdItem.getSection().annotateSection(annotatedBytes, this, stringCount);
StringIdItem.getAnnotator().annotateSection(annotatedBytes, this, stringCount);
annotatedBytes.annotate(0, " ");
TypeIdItem.getSection().annotateSection(annotatedBytes, this, typeCount);
TypeIdItem.getAnnotator().annotateSection(annotatedBytes, this, typeCount);
annotatedBytes.writeAnnotations(out, buf);
}

View File

@ -50,6 +50,8 @@ public class HeaderItem {
public static final int CHECKSUM_OFFSET = 8;
public static final int SIGNATURE_OFFSET = 12;
public static final int SIGNATURE_SIZE = 20;
public static final int ENDIAN_TAG_OFFSET = 40;
public static final int MAP_OFFSET = 52;
@ -72,10 +74,8 @@ public class HeaderItem {
public static final int CLASS_COUNT_OFFSET = 96;
public static final int CLASS_START_OFFSET = 100;
public static final int SIGNATURE_SIZE = 20;
public static Section getSection() {
return new Section() {
public static SectionAnnotator getAnnotator() {
return new SectionAnnotator() {
@Override
public void annotateSection(@Nonnull AnnotatedBytes out, @Nonnull DexBackedDexFile dexFile, int length) {
int startOffset = out.getCursor();

View File

@ -36,7 +36,7 @@ import org.jf.dexlib2.util.AnnotatedBytes;
import javax.annotation.Nonnull;
public interface Section {
public interface SectionAnnotator {
/**
* Write out annotations for this section

View File

@ -40,8 +40,8 @@ import javax.annotation.Nonnull;
public class StringIdItem {
public static final int ITEM_SIZE = 4;
public static Section getSection() {
return new Section() {
public static SectionAnnotator getAnnotator() {
return new SectionAnnotator() {
@Override
public void annotateSection(@Nonnull AnnotatedBytes out, @Nonnull DexBackedDexFile dexFile, int length) {
int startOffset = out.getCursor();

View File

@ -40,8 +40,8 @@ import javax.annotation.Nonnull;
public class TypeIdItem {
public static final int ITEM_SIZE = 4;
public static Section getSection() {
return new Section() {
public static SectionAnnotator getAnnotator() {
return new SectionAnnotator() {
@Override
public void annotateSection(@Nonnull AnnotatedBytes out, @Nonnull DexBackedDexFile dexFile, int length) {
int startOffset = out.getCursor();