A lightweight handle to a single DEX field.
More...
#include <analysis/field.hpp>
A lightweight handle to a single DEX field.
Get one from Class::fields(). The handle keeps shared ownership of the analysis, so it remains valid after every AnalysisContext wrapper has been destroyed. It stores the absolute field_ids index and the access flags from the EncodedField entry in class_data_item.
◆ name()
| std::string_view dex::Field::name |
( |
| ) |
const |
Simple name of the field (e.g. "out", "TAG").
◆ declaring_class()
| ClassRef dex::Field::declaring_class |
( |
| ) |
const |
ClassRef for the class that declares this field.
◆ type()
| std::string_view dex::Field::type |
( |
| ) |
const |
Descriptor of the field's declared type, such as "I" or "Ljava/lang/String;".
The view stays valid for the lifetime of the AnalysisContext.
◆ id()
The field's identity: its class, name and type.
It is the identity the cross-references use, so a Field can be looked up in them with it.
◆ access_flags()
◆ is_public()
| bool dex::Field::is_public |
( |
| ) |
const |
|
inline |
◆ is_static()
| bool dex::Field::is_static |
( |
| ) |
const |
|
inline |
◆ is_final()
| bool dex::Field::is_final |
( |
| ) |
const |
|
inline |
◆ annotations()
| std::vector< Annotation > dex::Field::annotations |
( |
| ) |
const |
Annotations attached to this field, resolved.
Parsed on demand.
◆ initial_value()
The recorded initial value of a static field, from the class's static_values encoded array.
nullopt when the field is not static, has no recorded value, or sits past the array's prefix — all of which mean "the type's default value" (0 / null) at runtime.
◆ operator==()
| bool dex::Field::operator== |
( |
const Field & |
| ) |
const |
|
default |
Two handles are equal when they come from the same analysis (one AnalysisContext, or copies of it) and point at the same field of the same DEX file.
Handles from two contexts that loaded the same file are not equal. std::hash<Field> is consistent with it.
◆ std::hash< Field >
| friend struct std::hash< Field > |
|
friend |
◆ Class
The documentation for this class was generated from the following file: