Class: JavaClass::AnnotationDefaultAttribute
- Defined in:
- lib/javaclass/attribute.rb
Overview
アノテーションの初期値属性
Instance Attribute Summary collapse
-
#element_value ⇒ Object
Returns the value of attribute element_value.
Attributes inherited from Attribute
Instance Method Summary collapse
-
#initialize(java_class, name_index, element_value = nil) ⇒ AnnotationDefaultAttribute
constructor
コンストラクタ.
- #to_bytes ⇒ Object
- #to_s ⇒ Object
Methods inherited from Attribute
Methods included from Base
#==, #===, #dump, #eql?, #hash, #to_byte
Constructor Details
#initialize(java_class, name_index, element_value = nil) ⇒ AnnotationDefaultAttribute
コンストラクタ
*java_class::属性の所有者であるJavaクラス *name_index::名前を示すconstant_poolのインデックス *element_value::アノテーションの初期値
757 758 759 760 |
# File 'lib/javaclass/attribute.rb', line 757 def initialize( java_class, name_index, element_value=nil ) super( java_class, name_index) @element_value = element_value end |
Instance Attribute Details
#element_value ⇒ Object
Returns the value of attribute element_value.
771 772 773 |
# File 'lib/javaclass/attribute.rb', line 771 def element_value @element_value end |
Instance Method Details
#to_bytes ⇒ Object
764 765 766 767 768 769 |
# File 'lib/javaclass/attribute.rb', line 764 def to_bytes bytes = super body = element_value.to_bytes() bytes += to_byte( body.length, 4) bytes += body end |
#to_s ⇒ Object
761 762 763 |
# File 'lib/javaclass/attribute.rb', line 761 def to_s "default " << @element_value.to_s end |