This is namespace allows you to build aspects. Aspects are an algorithmic representation of a code transformation or validation.
For instance, adding logging to a method, or implementing
INotifyPropertyChanged, can to a great extent be expressed as
an algorithm and therefore implemented as an aspect.
See Creating aspects.
To create an aspect, create a class that derives from Attribute and implement the IAspect<T> interface. Alternatively, you can use one of the following classes, which already XX derive from Attribute, have the proper AttributeUsageAttribute, and implement the IAspect<T> interface:
Scope custom attributes
Adding child aspects and validators
The IAspectPredecessor facility allows aspects to access their parent (i.e. the artifact that created them): a parent aspect, a fabric, or a custom attribute.
A base class from aspects that can be applied as custom attributes. Aspects must implement a specific generic instance of the IAspect<T> interface, or derive from TypeAspect, MethodAspect, ConstructorAspect, FieldOrPropertyAspect, EventAspect or CompilationAspect.
Custom attribute that specifies the order of run-time execution of aspects or aspect layers.
Represents the relationship that an object (attribute, fabric, aspect) has created or required another aspect or validator. These relationships are exposed on Predecessors.
Extension methods for IAspectPredecessor.
Kinds of AspectPredecessor.
A base class for aspects that can be applied the compilation as custom attributes (using the
[assembly: MyAspect] syntax).
This custom attribute is internal to the Metalama infrastructure and should not be used in user code. It is added by Metalama when an aspect is compile to store the original characteristics of the template because some are changed during compilation.
Attribute that means that the target declaration (and all children declarations) can only be called from compile-time code and, therefore, not from run-time code. See RunTimeOrCompileTimeAttribute for declarations that can be called both from compile-time and run-time code.
A base class for aspects that can be applied to constructors as custom attributes.
A base aspect that can validate or change the value of fields, properties, indexers, and parameters.
Directions of the data flow to which the contract applies.
A base class for attributes that define declarative advice members.
A base class for aspects that can be applied to events as custom attributes.
Custom attribute attribute that, when applied to a declaration, specifies that this declaration and all its members must not be the target of aspects of given types, unless the aspect is explicitly specified as a custom attribute.
A base class for aspects that can be applied to fields as custom attributes.
A base class for aspects that can be applied to fields or properties as custom attributes.
Custom attribute that, when applied to an aspect class, means that instances of this aspect are inherited from the base class or interface to derived classes, from base methods to method overrides, from interface methods to method implementations, and so on.
Custom attribute that applied to a member of an aspect class and means that this aspect member is a template implementing a member of an interface implemented by ImplementInterface(INamedType, INamedType, OverrideStrategy, Object).
Member conflict behavior of interface introduction advice.
Custom attribute that can be applied to any member of an aspect class and that means that this member must be introduced to the target class of the aspect.
Scope of introduction advice.
An exception thrown by IAdviceFactory when compile-time code attempts to add a template to a target declaration and the template is not compatible with the advice and the target declaration.
Custom attribute that, when applied to an aspect class, means that this aspect class uses several layers, and defines the name and the order of execution of these layers. In multi-aspect layers, the BuildAspect(IAspectBuilder<T>) method is called several times, once for each layer. The current layer is exposed in the Layer property.
The entry point for the meta model, which can be used in templates to inspect the target code or access other features of the template language.
A base class for aspects that can be applied to methods as custom attributes.
A base aspect that overrides the implementation of an event.
A base aspect that overrides the implementation of a method.
A base aspect that overrides the implementation of a method.
Conflict behavior of introduction advice.
A base class for aspects that can be applied to parameters as custom attributes.
A base class for aspects that can be applied to properties as custom attributes.
Custom attribute that, when applied an an aspect class, means that this aspect class is implemented by a low-level weaver built with Metalama SDK. When the RequireAspectWeaverAttribute is added to a type, the BuildAspect(IAspectBuilder<T>) method is not invoked.
Attribute that means that the target declaration (and all children declarations) can be called both from compile-time and run-time code. See CompileTimeAttribute for declarations that cannot be called from run-time code.
A base class for all custom attributes that influence the scope (compile-time or run-time) of the code or its role in an aspect.
The base class for all custom attributes that mark a declaration as a template.
A base class for aspects that can be applied to types as custom attributes.
A base class for aspects that can be applied to type parameters (i.e. generic parameters) as custom attributes.
The base interface for all aspects. A class should not implement this interface, but the strongly-typed variant IAspect<T>.
The base interface for all aspects, with the type parameter indicating to which types of declarations the aspect can be added.
An object used by the BuildAspect(IAspectBuilder<T>) method of the aspect to provide advice, child aspects and validators, or report diagnostics. This is the weakly-typed variant of the IAspectBuilder<TAspectTarget> interface.
An object used by the BuildAspect(IAspectBuilder<T>) method of the aspect to provide advice, child aspects and validators, or report diagnostics. This is a strongly-typed variant of the IAspectBuilder interface.
Represents the metadata of an aspect class.
Represents an instance of an aspect. The instance of the IAspect itself is in the Aspect property.
Base interface for objects that can cause aspects to be added to a compilation. Predecessors are exposed on the Predecessors property.
Represents a set of declarations and offers the ability to add aspects, annotations to them. It inherits from IValidatorReceiver<TDeclaration>, which allows to add validators.
An interface that allows aspects and fabrics to register aspects and validators for current compilation version.
An empty interface that must be implemented by objects assigned to the AspectState property of the IAspectBuilder interface.
An interface that can be implemented by aspect that can be inheritable or non-inheritable based of a field or property of the aspect. When the all instances of the aspect class are unconditionally inheritable, the class must be annotated with the InheritableAttribute instead.
Exposes as a dictionary the tags passed to an advise.
Base interface for types that define template members, which must be annotated with TemplateAttribute. To use an instance of this type, use the WithTemplateProvider(ITemplateProvider) method of the IAdviceFactory.