Class: BiteScript::ASM::ClassMirror::Builder
- Inherits:
-
Object
- Object
- BiteScript::ASM::ClassMirror::Builder
- Includes:
- BiteScript::ASM::ClassVisitor, FieldVisitor, MethodVisitor
- Defined in:
- lib/bitescript/mirror.rb
Instance Method Summary collapse
- #mirror ⇒ Object
- #to_s ⇒ Object
- #visit(version, access, name, signature, super_name, interfaces) ⇒ Object
- #visitAnnotation(desc, visible) ⇒ Object
- #visitAnnotationDefault(*args) ⇒ Object
- #visitAttribute(attribute) ⇒ Object
- #visitEnd ⇒ Object
- #visitField(flags, name, desc, signature, value) ⇒ Object
- #visitInnerClass(name, outer, inner, access) ⇒ Object
- #visitMethod(flags, name, desc, signature, exceptions) ⇒ Object
- #visitOuterClass(owner, name, desc) ⇒ Object
- #visitSource(source, debug) ⇒ Object
Instance Method Details
#mirror ⇒ Object
283 284 285 |
# File 'lib/bitescript/mirror.rb', line 283 def mirror @class end |
#to_s ⇒ Object
318 319 320 |
# File 'lib/bitescript/mirror.rb', line 318 def to_s "ClassMirror(#{type.class_name})" end |
#visit(version, access, name, signature, super_name, interfaces) ⇒ Object
273 274 275 276 277 278 279 280 281 |
# File 'lib/bitescript/mirror.rb', line 273 def visit(version, access, name, signature, super_name, interfaces) @current = @class = ClassMirror.new(Type.getObjectType(name), access) @class.superclass = Type.getObjectType(super_name) if super_name if interfaces interfaces.each do |i| @class.interfaces << Type.getObjectType(i) end end end |
#visitAnnotation(desc, visible) ⇒ Object
293 294 295 296 297 |
# File 'lib/bitescript/mirror.rb', line 293 def visitAnnotation(desc, visible) builder = AnnotationMirror::Builder.new(desc, visible) @current.addAnnotation(builder.annotation) builder end |
#visitAnnotationDefault(*args) ⇒ Object
316 |
# File 'lib/bitescript/mirror.rb', line 316 def visitAnnotationDefault(*args);end |
#visitAttribute(attribute) ⇒ Object
289 |
# File 'lib/bitescript/mirror.rb', line 289 def visitAttribute(attribute); end |
#visitEnd ⇒ Object
291 |
# File 'lib/bitescript/mirror.rb', line 291 def visitEnd; end |
#visitField(flags, name, desc, signature, value) ⇒ Object
299 300 301 302 303 |
# File 'lib/bitescript/mirror.rb', line 299 def visitField(flags, name, desc, signature, value) @current = FieldMirror.new(@class.type, flags, name, Type.getType(desc), value) @class.addField(@current) self end |
#visitInnerClass(name, outer, inner, access) ⇒ Object
290 |
# File 'lib/bitescript/mirror.rb', line 290 def visitInnerClass(name, outer, inner, access); end |
#visitMethod(flags, name, desc, signature, exceptions) ⇒ Object
305 306 307 308 309 310 311 312 313 314 |
# File 'lib/bitescript/mirror.rb', line 305 def visitMethod(flags, name, desc, signature, exceptions) return_type = Type.getReturnType(desc) parameters = Type.getArgumentTypes(desc).to_a exceptions = (exceptions || []).map {|e| Type.getObjectType(e)} @current = MethodMirror.new( @class.type, flags, return_type, name, parameters, exceptions) @class.addMethod(@current) # TODO parameter annotations, default value, etc. self # This isn't legal is it? end |
#visitOuterClass(owner, name, desc) ⇒ Object
288 |
# File 'lib/bitescript/mirror.rb', line 288 def visitOuterClass(owner, name, desc); end |
#visitSource(source, debug) ⇒ Object
287 |
# File 'lib/bitescript/mirror.rb', line 287 def visitSource(source, debug); end |