IMethodDefinition Interface
From The Oxygene Language Wiki
This is a Language topic
Feel free to add your notes to this topic below.
IMethodDefinition = public interface (IMemberDefinition, IAttributeDefinitionProvider, IAttributesProvider, IElementDefinition, IMethod, IMember, IGenericParametersProvider, IPosition)
A method definition interface is a reference to an in-code method. This interface allows the user to modify the method header and body.
Namespace: Cirrus
Members
| | |
|---|---|
| AddLocal(name: string; type: IType): ILocal; | Adds a local variable to the locals list |
| AddLocal(type: IType): ILocal; | Adds a local variable to the locals list. This local will not have a name (unless set later) and will not show up in the locals list during debugging |
| AddParameter(aName: String; aModifier: ParameterModifier; aType: IType): IParameterDefinition | Adds a new parameter to this method |
| GetLocal(aName: String): Value | Returns a local by name, or fails with an exception if it is not found. Used by the compiler |
| GetLocal(aName: String; aType: IType): Value | Returns a local by name, or fails with an exception if it is not found. Used by the compiler |
| GetLocal(no: Integer): ILocal] | Returns one of locals defined before the method "begin" block. LocalCount returns the number of locals defined there |
| GetParameter(aType: IType): Value | Returns a parameter by name, or fails with an exception if it is not found. Used by the compiler |
| GetParameter(aName: String; aType: IType): Value | Returns a parameter by name, or fails with an exception if it is not found. Used by the compiler |
| GetParameterArrayValue: ArrayValue | Returns an array with all parameters in it |
| GetResult(aType: IType): Value | Returns a value object for the result of this method |
| GetResult: Value | Returns a value object for the result of this method. |
| MethodBodyToStatementAnonymous: Value | Returns a value containing the body of this method as a value |
| RemoveParameter(aParameter: IParameterDefinition) | Removes a parameter from this method |
| RemoveParameter(aParameter: Integer) | Removes a parameter from this method |
| ReplaceMethodBody(aStatement: Statement) | Replaces the method of the body with the statement passed here. The original statement will be placed at the location of the PlaceHolderStatement |
| SurroundMethodBody(aBefore, aAfter: Statement; aMode: SurroundMethod) | Surrounds the original method with the before and after calls. |
Properties
| | |
|---|---|
| Final: Boolean | If true, this method is final and cannot be overridden |
| LocalCount: Integer | Returns the number of locals this method has (locals defined in a var block before the begin) |
| ParameterCount: Integer | Returns the number of parameters |
| Result: IType | Returns the result of this method, or nil if it has none |
| SpecialName: Boolean | Returns true if this method is a special name method, generally these are constructors and helper methods |
| Virtual: VirtualMode | The virtual mode of this method |
See Also
- Cirrus
- External Links:
- Prism Aspects to Help with Monobjc Development (RemObjects Blogs)
- IMemberDefinition Interface
- IAttributeDefinitionProvider Interface
- IAttributesProvider Interface
- IElementDefinition Interface
- IMethod Interface
- IMember Interface
- IGenericParametersProvider Interface
- IPosition Interface
Area: Oxygene Language
Compiler version: Oxygene 5
Language Glossary — Keywords — Types — FAQ — How To