Class: JavaClass::AnnotationElement
- Inherits:
-
Object
- Object
- JavaClass::AnnotationElement
- Includes:
- Base
- Defined in:
- lib/javaclass/attribute.rb
Overview
アノテーションのデータ
Instance Attribute Summary collapse
-
#name_index ⇒ Object
Returns the value of attribute name_index.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(java_class, name_index = nil, value = nil) ⇒ AnnotationElement
constructor
コンストラクタ.
- #name ⇒ Object
- #to_bytes ⇒ Object
- #to_s ⇒ Object
Methods included from Base
#==, #===, #dump, #eql?, #hash, #to_byte
Constructor Details
#initialize(java_class, name_index = nil, value = nil) ⇒ AnnotationElement
コンストラクタ
*java_class::属性の所有者であるJavaクラス *name_index::名前を示すconstant_poolのインデックス *value::値
501 502 503 504 505 |
# File 'lib/javaclass/attribute.rb', line 501 def initialize( java_class, name_index=nil, value=nil ) @java_class = java_class @name_index = name_index @value = value end |
Instance Attribute Details
#name_index ⇒ Object
Returns the value of attribute name_index.
517 518 519 |
# File 'lib/javaclass/attribute.rb', line 517 def name_index @name_index end |
#value ⇒ Object
Returns the value of attribute value.
518 519 520 |
# File 'lib/javaclass/attribute.rb', line 518 def value @value end |
Instance Method Details
#name ⇒ Object
506 507 508 |
# File 'lib/javaclass/attribute.rb', line 506 def name @java_class.get_constant_value(@name_index) end |
#to_bytes ⇒ Object
512 513 514 515 |
# File 'lib/javaclass/attribute.rb', line 512 def to_bytes bytes = to_byte( @name_index, 2) bytes += @value.to_bytes() end |
#to_s ⇒ Object
509 510 511 |
# File 'lib/javaclass/attribute.rb', line 509 def to_s "#{name} = #{value.to_s}" end |