Packageorg.as3commons.bytecode.emit
Interfacepublic interface IMethodBuilder extends IEmitMember, IMethodBodyBuilder, IEmitObject, IMetadataContainer
Implementors MethodBuilder

Describes an object that can generate a MethodInfo instance to be used in an AbcFile.



Public Properties
 PropertyDefined By
  arguments : Array
An Array of MethodArguments.
IMethodBuilder
 InheritedconstantPool : IConstantPool
IMethodBodyBuilder
 InheritedexceptionInfos : Vector.<ExceptionInfo>
An Array of IExceptionInfoBuilders that are able to generate the necessary ExceptionInfo instances references in the method body.
IMethodBodyBuilder
  hasOptionalArguments : Boolean
[read-only] Returns true if one or more of the current IMethodBuilder's arguments has its isOptional property set to true;
IMethodBuilder
  hasRestArguments : Boolean
If true the generated method will support rest arguments (...rest).
IMethodBuilder
 InheritedisFinal : Boolean
If true this member is marked as final and cannot be overridden in subclasses.
IEmitMember
 InheritedisOverride : Boolean
If true this member overrides a member of a superclass.
IEmitMember
 InheritedisStatic : Boolean
If true this member is marked as static.
IEmitMember
 Inheritedmetadata : Array
an Array of IMetadataBuilder instances that describe the metadata that will be generated for the current IMetadataContainer.
IMetadataContainer
 Inheritedname : String
The name of the current IEmitObject.
IEmitObject
 InheritednamespaceURI : String
The namespace URL that the current IEmitObject belongs to.
IEmitObject
 InheritedneedActivation : Boolean
[read-only]
IMethodBodyBuilder
 InheritedneedArguments : Boolean
IMethodBodyBuilder
 Inheritedopcodes : Vector.<Op>
An Array of Op instances that represent the programming logic inside the method.
IMethodBodyBuilder
 InheritedpackageName : String
The fully qualified package name for the current IEmitObject.
IEmitObject
  returnType : String
The fully qualified type of the return value of the generated MethodBody.
IMethodBuilder
 InheritedscopeName : String
The scope name that the current IEmitObject belongs to.
IEmitObject
 InheritedsetDXNS : Boolean
[read-only]
IMethodBodyBuilder
 Inheritedtrait : TraitInfo
The TraitInfo that is associated with the current IEmitObject, this is usually generated automatically and needs not to be set.
IEmitObject
 Inheritedvisibility : MemberVisibility
The visibility of the current IEmitObject within the package.
IEmitObject
Public Methods
 MethodDefined By
 Inherited
Parses and converts the specified opcode source and adds the resulting Op collection the current IMethodBodyBuilder.
IMethodBodyBuilder
 Inherited
addBackPatches(newBackpatches:Array):IMethodBodyBuilder
IMethodBodyBuilder
 Inherited
Adds the specified Op instance.
IMethodBodyBuilder
 Inherited
addOpcode(opcode:Opcode, params:Array = null):IMethodBodyBuilder
Adds an extra Op instance with the specified Opcode and parameters.
IMethodBodyBuilder
 Inherited
addOpcodes(newOpcodes:Vector.<Op>):IMethodBodyBuilder
Adds an Array of Op instances.
IMethodBodyBuilder
  
build(initScopeDepth:uint = 1):MethodInfo
Internally used build method, this method should never be called by third parties.
IMethodBuilder
 Inherited
buildBody(initScopeDepth:uint = 1, extraLocalCount:uint = 0):MethodBody
Internally used build method, this method should never be called by third parties.
IMethodBodyBuilder
  
defineArgument(type:String, isOptional:Boolean = false, defaultValue:Object = null):MethodArgument
Creates and returns a new MethodArgument for the current method.
IMethodBuilder
 Inherited
Creates and returns a new IExceptionInfoBuilder instance.
IMethodBodyBuilder
 Inherited
defineJump(triggerOpcode:Op, targetOpcode:Op, isDefault:Boolean = false):IMethodBodyBuilder
Defines a jump between the triggerOpcode and targetOpcode, for example, an iffalse opcode can trigger a jump to an opcode further down the chain of command if it resolves to true.
IMethodBodyBuilder
 Inherited
defineMetadata(name:String = null, arguments:Array = null):IMetadataBuilder
Creates an IMetadataBuilder instance that is able to generate a metadata entry for the current IMetadataContainer.
IMetadataContainer
Property Detail
argumentsproperty
arguments:Array

An Array of MethodArguments.


Implementation
    public function get arguments():Array
    public function set arguments(value:Array):void
hasOptionalArgumentsproperty 
hasOptionalArguments:Boolean  [read-only]

Returns true if one or more of the current IMethodBuilder's arguments has its isOptional property set to true;


Implementation
    public function get hasOptionalArguments():Boolean
hasRestArgumentsproperty 
hasRestArguments:Boolean

If true the generated method will support rest arguments (...rest).


Implementation
    public function get hasRestArguments():Boolean
    public function set hasRestArguments(value:Boolean):void
returnTypeproperty 
returnType:String

The fully qualified type of the return value of the generated MethodBody. I.e. flash.utils.Dictionary.


Implementation
    public function get returnType():String
    public function set returnType(value:String):void
Method Detail
build()method
public function build(initScopeDepth:uint = 1):MethodInfo

Internally used build method, this method should never be called by third parties.

Parameters

initScopeDepth:uint (default = 1)

Returns
MethodInfo
defineArgument()method 
public function defineArgument(type:String, isOptional:Boolean = false, defaultValue:Object = null):MethodArgument

Creates and returns a new MethodArgument for the current method.

Parameters

type:String — The fully qualified type for the argument. I.e. flash.events.Event
 
isOptional:Boolean (default = false) — The default value for the argument when the isOptional property is set to true.
 
defaultValue:Object (default = null)

Returns
MethodArgument — The specified MethodArgument.