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.
108 109 110 111 112 113 |
# File 'lib/android/dex/info.rb', line 108 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)
100 101 102 |
# File 'lib/android/dex/info.rb', line 100 def access_flags @access_flags end |
#name ⇒ String (readonly)
Returns field name.
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/android/dex/info.rb', line 98 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.
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/android/dex/info.rb', line 98 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.
116 117 118 |
# File 'lib/android/dex/info.rb', line 116 def definition "#{@access_flags.to_s} #{type} #{name}" end |