Package org.jf.dexlib2.dexbacked
Class DexBackedField
java.lang.Object
org.jf.dexlib2.base.reference.BaseReference
org.jf.dexlib2.base.reference.BaseFieldReference
org.jf.dexlib2.dexbacked.DexBackedField
- All Implemented Interfaces:
Comparable<FieldReference>,Annotatable,Field,Member,FieldReference,Reference
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jf.dexlib2.iface.reference.Reference
Reference.InvalidReferenceException -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal intfinal intfinal ClassDeffinal DexBackedDexFileprivate intfinal intprivate final intfinal EncodedValueprivate final intprivate final int -
Constructor Summary
ConstructorsConstructorDescriptionDexBackedField(DexBackedDexFile dexFile, DexReader reader, DexBackedClassDef classDef, int previousFieldIndex, AnnotationsDirectory.AnnotationIterator annotationIterator, int hiddenApiRestrictions) DexBackedField(DexBackedDexFile dexFile, DexReader reader, DexBackedClassDef classDef, int previousFieldIndex, EncodedArrayItemIterator staticInitialValueIterator, AnnotationsDirectory.AnnotationIterator annotationIterator, int hiddenApiRestrictions) -
Method Summary
Modifier and TypeMethodDescriptionintGets the access flags for this field.Set<? extends DexBackedAnnotation> Gets a set of the annotations that are applied to this field.Gets the type of the class that defines this field.private intGets the hidden api restrictions for this field.Gets the initial value for this field, if available.getName()Gets the name of this field.intgetSize()Calculate and return the private size of a field definition.getType()Gets the type of this field.static voidskipFields(DexReader reader, int count) Skips the reader over the specified number of encoded_field structuresMethods inherited from class org.jf.dexlib2.base.reference.BaseFieldReference
compareTo, equals, hashCode, toStringMethods inherited from class org.jf.dexlib2.base.reference.BaseReference
validateReferenceMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jf.dexlib2.iface.reference.FieldReference
compareTo, equals, hashCodeMethods inherited from interface org.jf.dexlib2.iface.reference.Reference
validateReference
-
Field Details
-
dexFile
-
classDef
-
accessFlags
public final int accessFlags -
initialValue
-
annotationSetOffset
public final int annotationSetOffset -
fieldIndex
public final int fieldIndex -
startOffset
private final int startOffset -
initialValueOffset
private final int initialValueOffset -
fieldIdItemOffset
private int fieldIdItemOffset
-
-
Constructor Details
-
DexBackedField
public DexBackedField(@Nonnull DexBackedDexFile dexFile, @Nonnull DexReader reader, @Nonnull DexBackedClassDef classDef, int previousFieldIndex, @Nonnull EncodedArrayItemIterator staticInitialValueIterator, @Nonnull AnnotationsDirectory.AnnotationIterator annotationIterator, int hiddenApiRestrictions) -
DexBackedField
public DexBackedField(@Nonnull DexBackedDexFile dexFile, @Nonnull DexReader reader, @Nonnull DexBackedClassDef classDef, int previousFieldIndex, @Nonnull AnnotationsDirectory.AnnotationIterator annotationIterator, int hiddenApiRestrictions)
-
-
Method Details
-
getName
Description copied from interface:FieldGets the name of this field. -
getType
Description copied from interface:FieldGets the type of this field.- Specified by:
getTypein interfaceField- Specified by:
getTypein interfaceFieldReference- Returns:
- The type of this field
-
getDefiningClass
Description copied from interface:FieldGets the type of the class that defines this field.- Specified by:
getDefiningClassin interfaceField- Specified by:
getDefiningClassin interfaceFieldReference- Specified by:
getDefiningClassin interfaceMember- Returns:
- The type of the class that defines this field
-
getAccessFlags
public int getAccessFlags()Description copied from interface:FieldGets the access flags for this field. This will be a combination of the AccessFlags.* flags that are marked as compatible for use with a field.- Specified by:
getAccessFlagsin interfaceField- Specified by:
getAccessFlagsin interfaceMember- Returns:
- The access flags for this field
-
getInitialValue
Description copied from interface:FieldGets the initial value for this field, if available. Only static field may have an initial value set, but are not required to have an initial value.- Specified by:
getInitialValuein interfaceField- Returns:
- The initial value for this field, or null if this field is not a static field, or if this static field does not have an initial value.
-
getAnnotations
Description copied from interface:FieldGets a set of the annotations that are applied to this field. The annotations in the returned set are guaranteed to have unique types.- Specified by:
getAnnotationsin interfaceAnnotatable- Specified by:
getAnnotationsin interfaceField- Returns:
- A set of the annotations that are applied to this field
-
getHiddenApiRestrictions
Description copied from interface:FieldGets the hidden api restrictions for this field. This will contain at most 1 normal flag (with isDomainSpecificApiFlag() = false), and 1 domain-specific api flag (with isDomainSpecificApiFlag() = true)- Specified by:
getHiddenApiRestrictionsin interfaceField- Specified by:
getHiddenApiRestrictionsin interfaceMember- Returns:
- A set of the hidden api restrictions for this field.
-
skipFields
Skips the reader over the specified number of encoded_field structures- Parameters:
reader- The reader to skipcount- The number of encoded_field structures to skip over
-
getFieldIdItemOffset
private int getFieldIdItemOffset() -
getSize
public int getSize()Calculate and return the private size of a field definition. Calculated as: field_idx_diff + access_flags + annotations overhead + initial value size + field reference size- Returns:
- size in bytes
-