Package org.jf.dexlib2.dexbacked
Class DexBackedMethod
java.lang.Object
org.jf.dexlib2.base.reference.BaseReference
org.jf.dexlib2.base.reference.BaseMethodReference
org.jf.dexlib2.dexbacked.DexBackedMethod
- All Implemented Interfaces:
Comparable<MethodReference>,Annotatable,Member,Method,MethodReference,Reference
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jf.dexlib2.iface.reference.Reference
Reference.InvalidReferenceException -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal intfinal DexBackedClassDefprivate final intfinal DexBackedDexFileprivate final intprivate final intprivate intfinal intprivate final intprivate intprivate intprivate final int -
Constructor Summary
ConstructorsConstructorDescriptionDexBackedMethod(DexBackedDexFile dexFile, DexReader reader, DexBackedClassDef classDef, int previousMethodIndex, int hiddenApiRestrictions) DexBackedMethod(DexBackedDexFile dexFile, DexReader reader, DexBackedClassDef classDef, int previousMethodIndex, AnnotationsDirectory.AnnotationIterator methodAnnotationIterator, AnnotationsDirectory.AnnotationIterator paramaterAnnotationIterator, int hiddenApiRestrictions) -
Method Summary
Modifier and TypeMethodDescriptionintGets the access flags for this method.Set<? extends Annotation> Gets a set of the annotations that are applied to this method.Gets the type of the class that defines this method.Gets the hidden api restrictions for this method.Gets a MethodImplementation object that defines the implementation of the method.private intintgetName()Gets the name of this method.List<? extends Set<? extends DexBackedAnnotation>> List<? extends MethodParameter> Gets a list of the parameters of this method.private intGets a list of the types of the parameters of this method.private intGets the return type of this method.intgetSize()Calculate and return the private size of a method definition.static voidskipMethods(DexReader reader, int count) Skips the reader over the specified number of encoded_method structuresMethods inherited from class org.jf.dexlib2.base.reference.BaseMethodReference
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.MethodReference
compareTo, equals, hashCodeMethods inherited from interface org.jf.dexlib2.iface.reference.Reference
validateReference
-
Field Details
-
dexFile
-
classDef
-
accessFlags
public final int accessFlags -
codeOffset
private final int codeOffset -
parameterAnnotationSetListOffset
private final int parameterAnnotationSetListOffset -
methodAnnotationSetOffset
private final int methodAnnotationSetOffset -
methodIndex
public final int methodIndex -
startOffset
private final int startOffset -
methodIdItemOffset
private int methodIdItemOffset -
protoIdItemOffset
private int protoIdItemOffset -
parametersOffset
private int parametersOffset
-
-
Constructor Details
-
DexBackedMethod
public DexBackedMethod(@Nonnull DexBackedDexFile dexFile, @Nonnull DexReader reader, @Nonnull DexBackedClassDef classDef, int previousMethodIndex, int hiddenApiRestrictions) -
DexBackedMethod
public DexBackedMethod(@Nonnull DexBackedDexFile dexFile, @Nonnull DexReader reader, @Nonnull DexBackedClassDef classDef, int previousMethodIndex, @Nonnull AnnotationsDirectory.AnnotationIterator methodAnnotationIterator, @Nonnull AnnotationsDirectory.AnnotationIterator paramaterAnnotationIterator, int hiddenApiRestrictions)
-
-
Method Details
-
getMethodIndex
public int getMethodIndex() -
getDefiningClass
Description copied from interface:MethodGets the type of the class that defines this method.- Specified by:
getDefiningClassin interfaceMember- Specified by:
getDefiningClassin interfaceMethod- Specified by:
getDefiningClassin interfaceMethodReference- Returns:
- The type of the class that defines this method
-
getAccessFlags
public int getAccessFlags()Description copied from interface:MethodGets the access flags for this method. This will be a combination of the AccessFlags.* flags that are marked as compatible for use with a method.- Specified by:
getAccessFlagsin interfaceMember- Specified by:
getAccessFlagsin interfaceMethod- Returns:
- The access flags for this method
-
getName
Description copied from interface:MethodGets the name of this method. -
getReturnType
Description copied from interface:MethodGets the return type of this method.- Specified by:
getReturnTypein interfaceMethod- Specified by:
getReturnTypein interfaceMethodReference- Returns:
- The return type of this method.
-
getParameters
Description copied from interface:MethodGets a list of the parameters of this method. As per the MethodReference interface, the MethodParameter objects contained in the returned list also act as a simple reference to the type of the parameter. However, the MethodParameter object can also contain additional information about the parameter. Note: In some implementations, the returned list is likely to *not* provide efficient random access.- Specified by:
getParametersin interfaceMethod- Returns:
- A list of MethodParameter objects, representing the parameters of this method.
-
getParameterAnnotations
-
getParameterNames
-
getParameterTypes
Description copied from interface:MethodReferenceGets a list of the types of the parameters of this method.- Specified by:
getParameterTypesin interfaceMethodReference- Returns:
- A list of the parameter types of this method, as strings.
-
getAnnotations
Description copied from interface:MethodGets a set of the annotations that are applied to this method. The annotations in the returned set are guaranteed to have unique types.- Specified by:
getAnnotationsin interfaceAnnotatable- Specified by:
getAnnotationsin interfaceMethod- Returns:
- A set of the annotations that are applied to this method
-
getHiddenApiRestrictions
Description copied from interface:MethodGets the hidden api restrictions for this method. This will contain at most 1 normal flag (with isDomainSpecificApiFlag() = false), and 1 domain-specific api flag (with isDomainSpecificApiFlag() = true)- Specified by:
getHiddenApiRestrictionsin interfaceMember- Specified by:
getHiddenApiRestrictionsin interfaceMethod- Returns:
- A set of the hidden api restrictions for this method.
-
getImplementation
Description copied from interface:MethodGets a MethodImplementation object that defines the implementation of the method. If this is an abstract method in an abstract class, or an interface method in an interface definition, then the method has no implementation, and this will return null.- Specified by:
getImplementationin interfaceMethod- Returns:
- A MethodImplementation object defining the implementation of this method, or null if the method has no implementation
-
getMethodIdItemOffset
private int getMethodIdItemOffset() -
getProtoIdItemOffset
private int getProtoIdItemOffset() -
getParametersOffset
private int getParametersOffset() -
skipMethods
Skips the reader over the specified number of encoded_method structures- Parameters:
reader- The reader to skipcount- The number of encoded_method structures to skip over
-
getSize
public int getSize()Calculate and return the private size of a method definition. Calculated as: method_idx_diff + access_flags + code_off + implementation size + reference size- Returns:
- size in bytes
-