Class: Android::Dex::FieldInfo
- Inherits:
-
Object
- Object
- Android::Dex::FieldInfo
- Defined in:
- lib/android/dex/info.rb
Overview
field info object
Instance Attribute Summary collapse
- #access_flags ⇒ ClassAccessFlag readonly
-
#name ⇒ String
readonly
Field name.
-
#type ⇒ String
readonly
Field type.
Instance Method Summary collapse
-
#definition ⇒ String
Field definition.
-
#initialize(encoded_field, field_id, dex) ⇒ FieldInfo
constructor
A new instance of FieldInfo.
Constructor Details
#initialize(encoded_field, field_id, dex) ⇒ FieldInfo
Returns a new instance of FieldInfo.
89 90 91 92 93 94 |
# File 'lib/android/dex/info.rb', line 89 def initialize(encoded_field, field_id, dex) @dex = dex @encoded_field = encoded_field @field_id = field_id @access_flags = ClassAccessFlag.new(encoded_field[:access_flags]) end |
Instance Attribute Details
#access_flags ⇒ ClassAccessFlag (readonly)
81 82 83 |
# File 'lib/android/dex/info.rb', line 81 def access_flags @access_flags end |
#name ⇒ String (readonly)
Returns field name.
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/android/dex/info.rb', line 79 class FieldInfo # @return [ClassAccessFlag] attr_reader :access_flags def name @dex.strings[@dex.field_ids[@field_id][:name_idx]] end def type @dex.type_resolve(@dex.field_ids[@field_id][:type_idx]) end def initialize(encoded_field, field_id, dex) @dex = dex @encoded_field = encoded_field @field_id = field_id @access_flags = ClassAccessFlag.new(encoded_field[:access_flags]) end # @return [String] field definition def definition "#{@access_flags.to_s} #{type} #{name}" end end |
#type ⇒ String (readonly)
Returns field type.
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/android/dex/info.rb', line 79 class FieldInfo # @return [ClassAccessFlag] attr_reader :access_flags def name @dex.strings[@dex.field_ids[@field_id][:name_idx]] end def type @dex.type_resolve(@dex.field_ids[@field_id][:type_idx]) end def initialize(encoded_field, field_id, dex) @dex = dex @encoded_field = encoded_field @field_id = field_id @access_flags = ClassAccessFlag.new(encoded_field[:access_flags]) end # @return [String] field definition def definition "#{@access_flags.to_s} #{type} #{name}" end end |
Instance Method Details
#definition ⇒ String
Returns field definition.
97 98 99 |
# File 'lib/android/dex/info.rb', line 97 def definition "#{@access_flags.to_s} #{type} #{name}" end |