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.
505 506 507 508 509 510 511 512 513 514 515 |
# File 'lib/bitescript/mirror.rb', line 505 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.
494 495 496 |
# File 'lib/bitescript/mirror.rb', line 494 def exception_types @exception_types end |
#interfaces ⇒ Object (readonly)
Returns the value of attribute interfaces.
495 496 497 |
# File 'lib/bitescript/mirror.rb', line 495 def interfaces @interfaces end |
#parameter_types ⇒ Object (readonly)
Returns the value of attribute parameter_types.
494 495 496 |
# File 'lib/bitescript/mirror.rb', line 494 def parameter_types @parameter_types end |
#return_type ⇒ Object (readonly)
Returns the value of attribute return_type.
494 495 496 |
# File 'lib/bitescript/mirror.rb', line 494 def return_type @return_type end |
#superclass ⇒ Object (readonly)
Returns the value of attribute superclass.
495 496 497 |
# File 'lib/bitescript/mirror.rb', line 495 def superclass @superclass end |
#type_parameters ⇒ Object (readonly)
Returns the value of attribute type_parameters.
493 494 495 |
# File 'lib/bitescript/mirror.rb', line 493 def type_parameters @type_parameters end |
Instance Method Details
#class? ⇒ Boolean
501 502 503 |
# File 'lib/bitescript/mirror.rb', line 501 def class? superclass != nil end |
#method? ⇒ Boolean
497 498 499 |
# File 'lib/bitescript/mirror.rb', line 497 def method? return_type != nil end |
#visitClassBound ⇒ Object
521 522 523 |
# File 'lib/bitescript/mirror.rb', line 521 def visitClassBound GenericTypeBuilder.new {|bound| type_parameters[-1].bounds << bound} end |
#visitExceptionType ⇒ Object
537 538 539 |
# File 'lib/bitescript/mirror.rb', line 537 def visitExceptionType GenericTypeBuilder.new {|type| exception_types << type} end |
#visitFormalTypeParameter(name) ⇒ Object
517 518 519 |
# File 'lib/bitescript/mirror.rb', line 517 def visitFormalTypeParameter(name) type_parameters << TypeVariable.new(name) end |
#visitInterface ⇒ Object
545 546 547 |
# File 'lib/bitescript/mirror.rb', line 545 def visitInterface GenericTypeBuilder.new {|type| interfaces << type} end |
#visitInterfaceBound ⇒ Object
525 526 527 |
# File 'lib/bitescript/mirror.rb', line 525 def visitInterfaceBound GenericTypeBuilder.new {|bound| type_parameters[-1].bounds << bound} end |
#visitParameterType ⇒ Object
529 530 531 |
# File 'lib/bitescript/mirror.rb', line 529 def visitParameterType GenericTypeBuilder.new {|type| parameter_types << type} end |
#visitReturnType ⇒ Object
533 534 535 |
# File 'lib/bitescript/mirror.rb', line 533 def visitReturnType GenericTypeBuilder.new {|type| @return_type = type} end |
#visitSuperclass ⇒ Object
541 542 543 |
# File 'lib/bitescript/mirror.rb', line 541 def visitSuperclass GenericTypeBuilder.new {|type| @superclass = type} end |