Class: BiteScript::ASM::AnnotationMirror::Builder
- Inherits:
-
Object
- Object
- BiteScript::ASM::AnnotationMirror::Builder
- Includes:
- BiteScript::ASM::AnnotationVisitor
- Defined in:
- lib/bitescript/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 |
# File 'lib/bitescript/mirror.rb', line 75 def initialize(desc, visible) @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
80 81 82 83 84 85 86 87 88 89 |
# File 'lib/bitescript/mirror.rb', line 80 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
91 92 93 94 95 96 |
# File 'lib/bitescript/mirror.rb', line 91 def visitAnnotation(name, desc) child = AnnotationMirror.new(Type.getType(desc), @current) @current[name] = child @current = child self end |
#visitArray(name) ⇒ Object
98 99 100 101 102 |
# File 'lib/bitescript/mirror.rb', line 98 def visitArray(name) array = @current[name] = [] @current = ValueArray.new(@current, array) self end |
#visitEnd ⇒ Object
108 109 110 |
# File 'lib/bitescript/mirror.rb', line 108 def visitEnd @current = @current.parent end |