class Rasm::Java::FieldInfo

Attributes

attributes[R]
descriptor[R]

Public Class Methods

new(descriptor, attributes) click to toggle source
# File lib/rasm/java/structure.rb, line 8
def initialize(descriptor, attributes)
  @descriptor, @attributes = descriptor, attributes
end

Public Instance Methods

attribute_of(name) click to toggle source
# File lib/rasm/java/structure.rb, line 28
def attribute_of(name)
  attributes.detect{|attr| attr.name == name}
end
to_s() click to toggle source
# File lib/rasm/java/structure.rb, line 12
def to_s
  access = access_flags
  str = ''
  str << "\t// DEPRECATED\n" if access & ACC_DEPRECATED != 0
  str << "\t// access flags 0x%x\n" % access
  signature, constant_value = attribute_of('Signature'), attribute_of('ConstantValue')
  if signature
    str << "\t#{access_desc} #{typeof(signature.value)} #{name}"
  else
    str << "\t#{access_desc} #{typeof(descriptor)} #{name}"
  end
  str << " = #{constant_value.value}" if constant_value

  str
end