Aspects

Overview

The Aspects class is a dummy class that is recognized by the compiler. When the compiler encounters calls to methods on this class inside an anonymous method that is assigned to a StatementDelegate, it replaces them with the calls to the actual code required to insert these things.

Location

Class Methods


ClassName

When used in an anonymous aspect body, this will be replaced with the name of the current class

 

class method ClassName: String

 

static String ClassName()

 

static func ClassName() -> String

 

static String ClassName()

 

Shared Function ClassName() As String

GetParameters

When used in an anonymous aspect body, this will be replaced with an array of objects that contain the current parameters as values.

 

class method GetParameters: array of Object

 

static Object[] GetParameters()

 

static func GetParameters() -> Object...

 

static Object[] GetParameters()

 

Shared Function GetParameters() As Object()

MethodName

When used in an anonymous aspect body, this will be replaced with the name of the current method

 

class method MethodName: String

 

static String MethodName()

 

static func MethodName() -> String

 

static String MethodName()

 

Shared Function MethodName() As String

OriginalBody

Insert the body of original method at the place this method is called.

 

class method OriginalBody

 

static void OriginalBody()

 

static func OriginalBody()

 

static void OriginalBody()

 

Shared Sub OriginalBody()

RequireLocal

When used in an anonymous aspect body and assigned to an inline local, it will require this local to exist at runtime and be of the type T. Any change to the local variable will be reflected to the actual local.

 

class method RequireLocal: Object

 

static Object RequireLocal()

 

static func RequireLocal() -> Object

 

static Object RequireLocal()

 

Shared Function RequireLocal() As Object

RequireLocal<T>

 

class method RequireLocal<T>: T

 

static T RequireLocal<T>()

 

static func RequireLocal<T>() -> T

 

static T RequireLocal<T>()

 

Shared Function RequireLocal<T>() As T

RequireParameter

When used in an anonymous aspect body and assigned to an inline local, it will require this parameter to exist at runtime and be of the type T. Any change to the local variable will be reflected to the actual parameter.

 

class method RequireParameter: Object

 

static Object RequireParameter()

 

static func RequireParameter() -> Object

 

static Object RequireParameter()

 

Shared Function RequireParameter() As Object

RequireParameter<T>

 

class method RequireParameter<T>: T

 

static T RequireParameter<T>()

 

static func RequireParameter<T>() -> T

 

static T RequireParameter<T>()

 

Shared Function RequireParameter<T>() As T

RequireResult

When used in an anonymous aspect body and assigned to an inline local, it will require the function to have a result and be of the type T. Any change to the local variable will be reflected to the actual result.

 

class method RequireResult: Object

 

static Object RequireResult()

 

static func RequireResult() -> Object

 

static Object RequireResult()

 

Shared Function RequireResult() As Object

RequireResult<T>

 

class method RequireResult<T>: T

 

static T RequireResult<T>()

 

static func RequireResult<T>() -> T

 

static T RequireResult<T>()

 

Shared Function RequireResult<T>() As T