Class: BiteScript::ASM::SignatureMirror
- Inherits:
-
SignatureVisitor
- Object
- SignatureVisitor
- BiteScript::ASM::SignatureMirror
- Includes:
- SignatureVisitor
- Defined in:
- lib/bitescript/mirror.rb,
lib/bitescript/asm3/mirror.rb
Instance Attribute Summary collapse
-
#exception_types ⇒ Object
readonly
Returns the value of attribute exception_types.
-
#interfaces ⇒ Object
readonly
Returns the value of attribute interfaces.
-
#parameter_types ⇒ Object
readonly
Returns the value of attribute parameter_types.
-
#return_type ⇒ Object
readonly
Returns the value of attribute return_type.
-
#superclass ⇒ Object
readonly
Returns the value of attribute superclass.
-
#type_parameters ⇒ Object
readonly
Returns the value of attribute type_parameters.
Instance Method Summary collapse
- #class? ⇒ Boolean
-
#initialize(signature = nil) ⇒ SignatureMirror
constructor
A new instance of SignatureMirror.
- #method? ⇒ Boolean
- #visitClassBound ⇒ Object
- #visitExceptionType ⇒ Object
- #visitFormalTypeParameter(name) ⇒ Object
- #visitInterface ⇒ Object
- #visitInterfaceBound ⇒ Object
- #visitParameterType ⇒ Object
- #visitReturnType ⇒ Object
- #visitSuperclass ⇒ Object
Constructor Details
#initialize(signature = nil) ⇒ SignatureMirror
Returns a new instance of SignatureMirror.
463 464 465 466 467 468 469 470 471 472 473 |
# File 'lib/bitescript/mirror.rb', line 463 def initialize(signature=nil) super(BiteScript::ASM::Opcodes::ASM4) @type_parameters = [] @parameter_types = [] @exception_types = [] @interfaces = [] if (signature) reader = BiteScript::ASM::SignatureReader.new(signature) reader.accept(self) end end |
Instance Attribute Details
#exception_types ⇒ Object (readonly)
Returns the value of attribute exception_types.
452 453 454 |
# File 'lib/bitescript/mirror.rb', line 452 def exception_types @exception_types end |
#interfaces ⇒ Object (readonly)
Returns the value of attribute interfaces.
453 454 455 |
# File 'lib/bitescript/mirror.rb', line 453 def interfaces @interfaces end |
#parameter_types ⇒ Object (readonly)
Returns the value of attribute parameter_types.
452 453 454 |
# File 'lib/bitescript/mirror.rb', line 452 def parameter_types @parameter_types end |
#return_type ⇒ Object (readonly)
Returns the value of attribute return_type.
452 453 454 |
# File 'lib/bitescript/mirror.rb', line 452 def return_type @return_type end |
#superclass ⇒ Object (readonly)
Returns the value of attribute superclass.
453 454 455 |
# File 'lib/bitescript/mirror.rb', line 453 def superclass @superclass end |
#type_parameters ⇒ Object (readonly)
Returns the value of attribute type_parameters.
451 452 453 |
# File 'lib/bitescript/mirror.rb', line 451 def type_parameters @type_parameters end |
Instance Method Details
#class? ⇒ Boolean
459 460 461 |
# File 'lib/bitescript/mirror.rb', line 459 def class? superclass != nil end |
#method? ⇒ Boolean
455 456 457 |
# File 'lib/bitescript/mirror.rb', line 455 def method? return_type != nil end |
#visitClassBound ⇒ Object
479 480 481 |
# File 'lib/bitescript/mirror.rb', line 479 def visitClassBound GenericTypeBuilder.new {|bound| type_parameters[-1].bounds << bound} end |
#visitExceptionType ⇒ Object
495 496 497 |
# File 'lib/bitescript/mirror.rb', line 495 def visitExceptionType GenericTypeBuilder.new {|type| exception_types << type} end |
#visitFormalTypeParameter(name) ⇒ Object
475 476 477 |
# File 'lib/bitescript/mirror.rb', line 475 def visitFormalTypeParameter(name) type_parameters << TypeVariable.new(name) end |
#visitInterface ⇒ Object
503 504 505 |
# File 'lib/bitescript/mirror.rb', line 503 def visitInterface GenericTypeBuilder.new {|type| interfaces << type} end |
#visitInterfaceBound ⇒ Object
483 484 485 |
# File 'lib/bitescript/mirror.rb', line 483 def visitInterfaceBound GenericTypeBuilder.new {|bound| type_parameters[-1].bounds << bound} end |
#visitParameterType ⇒ Object
487 488 489 |
# File 'lib/bitescript/mirror.rb', line 487 def visitParameterType GenericTypeBuilder.new {|type| parameter_types << type} end |
#visitReturnType ⇒ Object
491 492 493 |
# File 'lib/bitescript/mirror.rb', line 491 def visitReturnType GenericTypeBuilder.new {|type| @return_type = type} end |
#visitSuperclass ⇒ Object
499 500 501 |
# File 'lib/bitescript/mirror.rb', line 499 def visitSuperclass GenericTypeBuilder.new {|type| @superclass = type} end |