Class: BiteScript::ASM::AnnotationMirror::Builder
- Inherits:
-
BiteScript::ASM::AnnotationVisitor
- Object
- BiteScript::ASM::AnnotationVisitor
- BiteScript::ASM::AnnotationMirror::Builder
- Includes:
- BiteScript::ASM::AnnotationVisitor
- Defined in:
- lib/bitescript/mirror.rb,
lib/bitescript/asm3/mirror.rb
Defined Under Namespace
Classes: ValueArray
Instance Attribute Summary collapse
-
#annotation ⇒ Object
readonly
Returns the value of attribute annotation.
Instance Method Summary collapse
-
#initialize(desc, visible) ⇒ Builder
constructor
A new instance of Builder.
- #visit(name, value) ⇒ Object
- #visitAnnotation(name, desc) ⇒ Object
- #visitArray(name) ⇒ Object
- #visitEnd ⇒ Object
- #visitEnum(name, desc, value) ⇒ Object
Constructor Details
#initialize(desc, visible) ⇒ Builder
Returns a new instance of Builder.
75 76 77 78 |
# File 'lib/bitescript/mirror.rb', line 75 def initialize(desc, visible) super(BiteScript::ASM::Opcodes::ASM4) @current = @annotation = AnnotationMirror.new(Type.getType(desc)) end |
Instance Attribute Details
#annotation ⇒ Object (readonly)
Returns the value of attribute annotation.
74 75 76 |
# File 'lib/bitescript/mirror.rb', line 74 def annotation @annotation end |
Instance Method Details
#visit(name, value) ⇒ Object
81 82 83 84 85 86 87 88 89 90 |
# File 'lib/bitescript/mirror.rb', line 81 def visit(name, value) case value when ArrayJavaProxy visitArray(name) value.each {|x| visit(name, x)} visitEnd else @current[name] = value end end |
#visitAnnotation(name, desc) ⇒ Object
92 93 94 95 96 97 |
# File 'lib/bitescript/mirror.rb', line 92 def visitAnnotation(name, desc) child = AnnotationMirror.new(Type.getType(desc), @current) @current[name] = child @current = child self end |
#visitArray(name) ⇒ Object
99 100 101 102 103 |
# File 'lib/bitescript/mirror.rb', line 99 def visitArray(name) array = @current[name] = [] @current = ValueArray.new(@current, array) self end |
#visitEnd ⇒ Object
109 110 111 |
# File 'lib/bitescript/mirror.rb', line 109 def visitEnd @current = @current.parent end |