Package org.jf.dexlib2.iface
Interface ClassDef
- All Superinterfaces:
Annotatable,CharSequence,Comparable<CharSequence>,Reference,TypeReference
- All Known Implementing Classes:
BuilderClassDef,ClassDefRewriter.RewrittenClassDef,DexBackedClassDef,ImmutableClassDef,PoolClassDef,ReflectionClassDef
This class represents a class definition.
It also acts as a TypeReference to itself. Any equality/comparison is based on its identity as a TypeReference,
and shouldn't take into account anything other than the type of this class.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jf.dexlib2.iface.reference.Reference
Reference.InvalidReferenceException -
Method Summary
Modifier and TypeMethodDescriptionintGets the access flags for this class.Set<? extends Annotation> Gets a set of the annotations that are applied to this class.Gets the direct methods that are defined by this class.Gets all the fields that are defined by this class.Gets the instance fields that are defined by this class.Gets a list of the interfaces that this class implements.Gets all the methods that are defined by this class.Gets the name of the primary source file that this class is defined in, if available.Gets the static fields that are defined by this class.Gets the superclass of this class.getType()Gets the class type.Gets the virtual methods that are defined by this class.Methods inherited from interface java.lang.CharSequence
charAt, chars, codePoints, isEmpty, length, subSequence, toStringMethods inherited from interface org.jf.dexlib2.iface.reference.Reference
validateReferenceMethods inherited from interface org.jf.dexlib2.iface.reference.TypeReference
compareTo, equals, hashCode
-
Method Details
-
getType
Gets the class type. This will be a type descriptor per the dex file specification.- Specified by:
getTypein interfaceTypeReference- Returns:
- The class type
-
getAccessFlags
int getAccessFlags()Gets the access flags for this class. This will be a combination of the AccessFlags.* flags that are marked as compatible for use with a class.- Returns:
- The access flags for this class
-
getSuperclass
Gets the superclass of this class. This will only be null if this is the base java.lang.Object class.- Returns:
- The superclass of this class
-
getInterfaces
Gets a list of the interfaces that this class implements.- Returns:
- A list of the interfaces that this class implements
-
getSourceFile
Gets the name of the primary source file that this class is defined in, if available. This will be the default source file associated with all methods defined in this class. This can be overridden for sections of an individual method with the SetSourceFile debug item.- Returns:
- The name of the primary source file for this class, or null if not available
-
getAnnotations
Gets a set of the annotations that are applied to this class. The annotations in the returned set are guaranteed to have unique types.- Specified by:
getAnnotationsin interfaceAnnotatable- Returns:
- A set of the annotations that are applied to this class
-
getStaticFields
Gets the static fields that are defined by this class. The static fields that are returned must have no duplicates.- Returns:
- The static fields that are defined by this class
-
getInstanceFields
Gets the instance fields that are defined by this class. The instance fields that are returned must have no duplicates.- Returns:
- The instance fields that are defined by this class
-
getFields
Gets all the fields that are defined by this class. This is a convenience method that combines getStaticFields() and getInstanceFields() The returned fields may be in any order. I.e. It's not safe to assume that all instance fields will come after all static fields. Note that there typically should not be any duplicate fields between the two, but some versions of dalvik inadvertently allow duplicate static/instance fields, and are supported here for completeness- Returns:
- A set of the fields that are defined by this class
-
getDirectMethods
Gets the direct methods that are defined by this class. The direct methods that are returned must have no duplicates.- Returns:
- The direct methods that are defined by this class.
-
getVirtualMethods
Gets the virtual methods that are defined by this class. The virtual methods that are returned must have no duplicates.- Returns:
- The virtual methods that are defined by this class.
-
getMethods
Gets all the methods that are defined by this class. This is a convenience method that combines getDirectMethods() and getVirtualMethods(). The returned methods may be in any order. I.e. It's not safe to assume that all virtual methods will come after all direct methods. Note that there typically should not be any duplicate methods between the two, but some versions of dalvik inadvertently allow duplicate direct/virtual methods, and are supported here for completeness- Returns:
- An iterable of the methods that are defined by this class.
-