A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.aws.amazon.com/cdk/api/v2/docs/constructs.Node.html below:

class Node · AWS CDK

class Node

Represents the construct node in the scope tree.

Initializer
new Node(host: Construct, scope: IConstruct, id: string)

Parameters

Properties Name Type Description addr string Returns an opaque tree-unique address for this construct. children IConstruct[] All direct children of this construct. dependencies IConstruct[] Return all dependencies registered on this node (non-recursive). id string The id of this construct within the current scope. locked boolean Returns true if this construct or the scopes in which it is defined are locked. metadata MetadataEntry[] An immutable array of metadata objects associated with this construct. path string The full, absolute path of this construct in the tree. root IConstruct Returns the root of the construct tree. scopes IConstruct[] All parent scopes of this construct. defaultChild? IConstruct Returns the child construct that has the id Default or Resource". scope? IConstruct Returns the scope in which this construct is defined. static PATH_SEP string Separator used to delimit construct path components. addr

Type: string

Returns an opaque tree-unique address for this construct.

Addresses are 42 characters hexadecimal strings. They begin with "c8" followed by 40 lowercase hexadecimal characters (0-9a-f).

Addresses are calculated using a SHA-1 of the components of the construct path.

To enable refactoring of construct trees, constructs with the ID Default will be excluded from the calculation. In those cases constructs in the same tree may have the same address. Example

c83a2846e506bcc5f10682b564084bca2d275709ee
children

Type: IConstruct[]

All direct children of this construct.

dependencies

Type: IConstruct[]

Return all dependencies registered on this node (non-recursive).

id

Type: string

The id of this construct within the current scope.

This is a scope-unique id. To obtain an app-unique id for this construct, use addr.

locked

Type: boolean

Returns true if this construct or the scopes in which it is defined are locked.

metadata

Type: MetadataEntry[]

An immutable array of metadata objects associated with this construct.

This can be used, for example, to implement support for deprecation notices, source mapping, etc.

path

Type: string

The full, absolute path of this construct in the tree.

Components are separated by '/'.

root

Type: IConstruct

Returns the root of the construct tree.

scopes

Type: IConstruct[]

All parent scopes of this construct.

defaultChild?

Type: IConstruct (optional)

Returns the child construct that has the id Default or Resource".

This is usually the construct that provides the bulk of the underlying functionality. Useful for modifications of the underlying construct that are not available at the higher levels. Override the defaultChild property.

This should only be used in the cases where the correct default child is not named 'Resource' or 'Default' as it should be.

If you set this to undefined, the default behavior of finding the child named 'Resource' or 'Default' will be used.

scope?

Type: IConstruct (optional)

Returns the scope in which this construct is defined.

The value is undefined at the root of the construct scope tree.

static PATH_SEP

Type: string

Separator used to delimit construct path components.

Methods Name Description addDependency(...deps) Add an ordering dependency on another construct. addMetadata(type, data, options?) Adds a metadata entry to this construct. addValidation(validation) Adds a validation to this construct. findAll(order?) Return this construct and all of its children in the given order. findChild(id) Return a direct child by id. getAllContext(defaults?) Retrieves the all context of a node from tree context. getContext(key) Retrieves a value from tree context if present. Otherwise, would throw an error. lock() Locks this construct from allowing more children to be added. setContext(key, value) This can be used to set contextual values. tryFindChild(id) Return a direct child by id, or undefined. tryGetContext(key) Retrieves a value from tree context. tryRemoveChild(childName) Remove the child with the given name, if present. validate() Validates this construct. static of(construct)⚠️ Returns the node associated with a construct. addDependency(...deps)
public addDependency(...deps: IDependable[]): void

Parameters

Add an ordering dependency on another construct.

An IDependable

addMetadata(type, data, options?)
public addMetadata(type: string, data: any, options?: MetadataOptions): void

Parameters

Adds a metadata entry to this construct.

Entries are arbitrary values and will also include a stack trace to allow tracing back to the code location for when the entry was added. It can be used, for example, to include source mapping in CloudFormation templates to improve diagnostics. Note that construct metadata is not the same as CloudFormation resource metadata and is never written to the CloudFormation template. The metadata entries are written to the Cloud Assembly Manifest if the treeMetadata property is specified in the props of the App that contains this Construct.

addValidation(validation)
public addValidation(validation: IValidation): void

Parameters

Adds a validation to this construct.

When node.validate() is called, the validate() method will be called on all validations and all errors will be returned.

findAll(order?)
public findAll(order?: ConstructOrder): IConstruct[]

Parameters

Returns

Return this construct and all of its children in the given order.

findChild(id)
public findChild(id: string): IConstruct

Parameters

Returns

Return a direct child by id.

Throws an error if the child is not found.

getAllContext(defaults?)
public getAllContext(defaults?: json): any

Parameters

Returns

Retrieves the all context of a node from tree context.

Context is usually initialized at the root, but can be overridden at any point in the tree.

getContext(key)
public getContext(key: string): any

Parameters

Returns

Retrieves a value from tree context if present. Otherwise, would throw an error.

Context is usually initialized at the root, but can be overridden at any point in the tree.

lock()
public lock(): void

Locks this construct from allowing more children to be added.

After this call, no more children can be added to this construct or to any children.

setContext(key, value)
public setContext(key: string, value: any): void

Parameters

This can be used to set contextual values.

Context must be set before any children are added, since children may consult context info during construction. If the key already exists, it will be overridden.

tryFindChild(id)
public tryFindChild(id: string): IConstruct

Parameters

Returns

Return a direct child by id, or undefined.

tryGetContext(key)
public tryGetContext(key: string): any

Parameters

Returns

Retrieves a value from tree context.

Context is usually initialized at the root, but can be overridden at any point in the tree.

tryRemoveChild(childName)
public tryRemoveChild(childName: string): boolean

Parameters

Returns

Remove the child with the given name, if present.

validate()
public validate(): string[]

Returns

Validates this construct.

Invokes the validate() method on all validations added through addValidation().

static of(construct)⚠️
public static of(construct: IConstruct): Node

⚠️ Deprecated: use construct.node instead

Parameters

Returns

Returns the node associated with a construct.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4