Class: BiteScript::ASM::MethodMirror

Inherits:
Object
  • Object
show all
Includes:
Annotated, Generics, Modifiers
Defined in:
lib/bitescript/mirror.rb,
lib/bitescript/asm3/mirror.rb

Defined Under Namespace

Classes: Builder

Instance Attribute Summary collapse

Attributes included from Modifiers

#flags

Instance Method Summary collapse

Methods included from Generics

#inspect_generic, #inspect_type

Methods included from Annotated

#addAnnotation, #annotations, #declaredAnnotations, #getDeclaredAnnotation, #inspect_annotations

Methods included from Modifiers

add_modifier

Constructor Details

#initialize(klass, flags, return_type, name, parameters, exceptions, signature) ⇒ MethodMirror

Returns a new instance of MethodMirror.



435
436
437
438
439
440
441
442
443
# File 'lib/bitescript/mirror.rb', line 435

def initialize(klass, flags, return_type, name, parameters, exceptions, signature)
  @flags = flags
  @declaring_class = klass
  @name = name
  @return_type = return_type
  @argument_types = parameters
  @exception_types = exceptions
  @signature = signature
end

Instance Attribute Details

#argument_typesObject (readonly)

Returns the value of attribute argument_types.



433
434
435
# File 'lib/bitescript/mirror.rb', line 433

def argument_types
  @argument_types
end

#declaring_classObject (readonly)

Returns the value of attribute declaring_class.



432
433
434
# File 'lib/bitescript/mirror.rb', line 432

def declaring_class
  @declaring_class
end

#exception_typesObject (readonly)

Returns the value of attribute exception_types.



433
434
435
# File 'lib/bitescript/mirror.rb', line 433

def exception_types
  @exception_types
end

#nameObject (readonly)

Returns the value of attribute name.



432
433
434
# File 'lib/bitescript/mirror.rb', line 432

def name
  @name
end

#return_typeObject (readonly)

Returns the value of attribute return_type.



432
433
434
# File 'lib/bitescript/mirror.rb', line 432

def return_type
  @return_type
end

#signatureObject (readonly)

Returns the value of attribute signature.



433
434
435
# File 'lib/bitescript/mirror.rb', line 433

def signature
  @signature
end

Instance Method Details

#generic_exception_typesObject



453
454
455
# File 'lib/bitescript/mirror.rb', line 453

def generic_exception_types
  signature.exception_types if signature
end

#generic_parameter_typesObject



445
446
447
# File 'lib/bitescript/mirror.rb', line 445

def generic_parameter_types
  signature.parameter_types if signature
end

#generic_return_typeObject



449
450
451
# File 'lib/bitescript/mirror.rb', line 449

def generic_return_type
  signature.return_type if signature
end

#inspectObject



461
462
463
464
465
466
467
468
469
470
471
# File 'lib/bitescript/mirror.rb', line 461

def inspect
  typevars = "<#{type_parameters.map{|p| p.to_s}.join ', '}> " if type_parameters && type_parameters.size != 0
  "%s%s%s%s %s(%s);" % [
    inspect_annotations,
    modifier_string,
    typevars,
    inspect_generic(return_type, generic_return_type),
    name,
    (generic_parameter_types || argument_types).map {|x| inspect_type(x)}.join(', '),
  ]
end

#type_parametersObject



457
458
459
# File 'lib/bitescript/mirror.rb', line 457

def type_parameters
  signature.type_parameters if signature
end