Class: JavaClass::ConstAnnotationElementValue
- Inherits:
-
AnnotationElementValue
- Object
- AnnotationElementValue
- JavaClass::ConstAnnotationElementValue
- Defined in:
- lib/javaclass/attribute.rb
Overview
定数のアノテーションデータ
Instance Attribute Summary collapse
-
#const_value_index ⇒ Object
定数値を示すconstant_poolのインデックス.
Attributes inherited from AnnotationElementValue
Instance Method Summary collapse
-
#initialize(java_class, tag = nil, const_value_index = nil) ⇒ ConstAnnotationElementValue
constructor
コンストラクタ.
- #to_bytes ⇒ Object
- #to_s ⇒ Object
- #value ⇒ Object
Methods included from Converters
convert_code, convert_field_descriptor, convert_method_descriptor
Methods included from Base
#==, #===, #dump, #eql?, #hash, #to_byte
Constructor Details
#initialize(java_class, tag = nil, const_value_index = nil) ⇒ ConstAnnotationElementValue
コンストラクタ
*java_class::属性の所有者であるJavaクラス*tag::データの種別を示すconstant_poolのインデックス*const_value_index::定数値を示すconstant_poolのインデックス
556 557 558 559 |
# File 'lib/javaclass/attribute.rb', line 556 def initialize( java_class, tag=nil, const_value_index=nil ) super( java_class, tag ) @const_value_index = const_value_index end |
Instance Attribute Details
#const_value_index ⇒ Object
定数値を示すconstant_poolのインデックス
571 572 573 |
# File 'lib/javaclass/attribute.rb', line 571 def const_value_index @const_value_index end |
Instance Method Details
#to_bytes ⇒ Object
566 567 568 569 |
# File 'lib/javaclass/attribute.rb', line 566 def to_bytes bytes = super bytes += to_byte( @const_value_index, 2) end |
#to_s ⇒ Object
563 564 565 |
# File 'lib/javaclass/attribute.rb', line 563 def to_s @java_class.get_constant_as_string(@const_value_index) end |
#value ⇒ Object
560 561 562 |
# File 'lib/javaclass/attribute.rb', line 560 def value @java_class.get_constant_value(@const_value_index) end |