class MixinApplicator
| Language | Type name |
|---|---|
.NET | Amazon.CDK.Mixins.Preview.core.MixinApplicator |
Go | github.com/aws/aws-cdk-go/awscdkmixinspreview/v2/core#MixinApplicator |
Java | software.amazon.awscdk.mixins.preview.core.MixinApplicator |
Python | aws_cdk.mixins_preview.core.MixinApplicator |
TypeScript (source) | @aws-cdk/mixins-preview ยป core ยป MixinApplicator |
Applies mixins to constructs.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { core } from '@aws-cdk/mixins-preview';
declare const constructSelector: core.IConstructSelector;
const mixinApplicator = new core.MixinApplicator(this, /* all optional props */ constructSelector);
Initializer
new MixinApplicator(scope: IConstruct, selector?: IConstructSelector)
Parameters
- scope
IConstruct - selector
IConstructSelector
Properties
| Name | Type | Description |
|---|---|---|
| report | Mixin[] | Returns the successful mixin applications. |
| selected | IConstruct[] | The constructs that match the selector in the given scope. |
report
Type:
Mixin[]
Returns the successful mixin applications.
selectedConstructs
Type:
IConstruct[]
The constructs that match the selector in the given scope.
Methods
| Name | Description |
|---|---|
| apply(...mixins) | Applies a mixin to selected constructs. |
| require | Requires all selected constructs to support the applied mixins. |
| require | Requires at least one mixin to be successfully applied. |
apply(...mixins)
public apply(...mixins: IMixin[]): MixinApplicator
Parameters
- mixins
IMixin
Returns
Applies a mixin to selected constructs.
requireAll()
public requireAll(): MixinApplicator
Returns
Requires all selected constructs to support the applied mixins.
Will only check for future call of apply().
Set this before calling apply() to take effect.
Example
Mixins.of(scope)
.requireAll()
.apply(new MyMixin());
requireAny()
public requireAny(): MixinApplicator
Returns
Requires at least one mixin to be successfully applied.
Will only check for future call of apply().
Set this before calling apply() to take effect.
Example
Mixins.of(scope)
.requireAny()
.apply(new MyMixin());

.NET
Go
Java
Python
TypeScript (