@Generated(value="jsii-pacmak/1.63.2 (build a8a8833)",
date="2022-08-09T19:16:31.419Z")
public class ConstructNode
extends software.amazon.jsii.JsiiObject
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.core.*; Construct construct; ConstructNode constructNode = new ConstructNode(construct, construct, "id");
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PATH_SEP
Separator used to delimit construct path components.
|
Modifier | Constructor and Description |
---|---|
|
ConstructNode(Construct host,
IConstruct scope,
java.lang.String id) |
protected |
ConstructNode(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
ConstructNode(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
void |
addDependency(IDependable... dependencies)
Add an ordering dependency on another Construct.
|
void |
addError(java.lang.String message)
Deprecated.
use `Annotations.of(construct).addError()`
|
void |
addInfo(java.lang.String message)
Deprecated.
use `Annotations.of(construct).addInfo()`
|
void |
addMetadata(java.lang.String type,
java.lang.Object data)
Adds a metadata entry to this construct.
|
void |
addMetadata(java.lang.String type,
java.lang.Object data,
java.lang.Object fromFunction)
Adds a metadata entry to this construct.
|
void |
addValidation(software.constructs.IValidation validation)
Add a validator to this construct Node.
|
void |
addWarning(java.lang.String message)
Deprecated.
use `Annotations.of(construct).addWarning()`
|
void |
applyAspect(IAspect aspect)
Deprecated.
This API is going to be removed in the next major version of
the AWS CDK. Please use `Aspects.of(scope).add()` instead.
|
java.util.List<IConstruct> |
findAll()
Return this construct and all of its children in the given order.
|
java.util.List<IConstruct> |
findAll(ConstructOrder order)
Return this construct and all of its children in the given order.
|
IConstruct |
findChild(java.lang.String id)
Return a direct child by id.
|
java.lang.String |
getAddr()
Returns an opaque tree-unique address for this construct.
|
java.util.List<IConstruct> |
getChildren()
All direct children of this construct.
|
IConstruct |
getDefaultChild()
Returns the child construct that has the id `Default` or `Resource"`.
|
java.util.List<Dependency> |
getDependencies()
Return all dependencies registered on this node or any of its children.
|
java.lang.String |
getId()
The id of this construct within the current scope.
|
java.lang.Boolean |
getLocked()
Returns true if this construct or the scopes in which it is defined are locked.
|
java.util.List<MetadataEntry> |
getMetadata()
Deprecated.
use `metadataEntry`
|
java.util.List<software.constructs.MetadataEntry> |
getMetadataEntry()
An immutable array of metadata objects associated with this construct.
|
java.lang.String |
getPath()
The full, absolute path of this construct in the tree.
|
IConstruct |
getRoot() |
IConstruct |
getScope()
Returns the scope in which this construct is defined.
|
java.util.List<IConstruct> |
getScopes()
All parent scopes of this construct.
|
java.lang.String |
getUniqueId()
Deprecated.
use `node.addr` to obtain a consistent 42 character address for
this node (see https://github.com/aws/constructs/pull/314).
Alternatively, to get a CloudFormation-compatible unique identifier, use
`Names.uniqueId()`.
|
static void |
prepare(ConstructNode node)
Deprecated.
Use `app.synth()` instead
|
void |
setContext(java.lang.String key,
java.lang.Object value)
This can be used to set contextual values.
|
void |
setDefaultChild(IConstruct value)
Returns the child construct that has the id `Default` or `Resource"`.
|
static CloudAssembly |
synth(ConstructNode node)
Deprecated.
Use `app.synth()` or `stage.synth()` instead
|
static CloudAssembly |
synth(ConstructNode node,
SynthesisOptions options)
Deprecated.
Use `app.synth()` or `stage.synth()` instead
|
IConstruct |
tryFindChild(java.lang.String id)
Return a direct child by id, or undefined.
|
java.lang.Object |
tryGetContext(java.lang.String key)
Retrieves a value from tree context.
|
java.lang.Boolean |
tryRemoveChild(java.lang.String childName)
Remove the child with the given name, if present.
|
static java.util.List<ValidationError> |
validate(ConstructNode node)
Invokes "validate" on all constructs in the tree (depth-first, pre-order) and returns the list of all errors.
|
public static final java.lang.String PATH_SEP
protected ConstructNode(software.amazon.jsii.JsiiObjectRef objRef)
protected ConstructNode(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public ConstructNode(Construct host, IConstruct scope, java.lang.String id)
host
- This parameter is required.scope
- This parameter is required.id
- This parameter is required.@Deprecated public static void prepare(ConstructNode node)
node
- The root node. This parameter is required.@Deprecated public static CloudAssembly synth(ConstructNode node, SynthesisOptions options)
node
- The root of the construct tree. This parameter is required.options
- Synthesis options.@Deprecated public static CloudAssembly synth(ConstructNode node)
node
- The root of the construct tree. This parameter is required.public static java.util.List<ValidationError> validate(ConstructNode node)
An empty list indicates that there are no errors.
node
- The root node. This parameter is required.public void addDependency(IDependable... dependencies)
All constructs in the dependency's scope will be deployed before any construct in this construct's scope.
dependencies
- This parameter is required.@Deprecated public void addError(java.lang.String message)
The toolkit will fail synthesis when errors are reported.
message
- The error message. This parameter is required.@Deprecated public void addInfo(java.lang.String message)
The toolkit will display the info message when apps are synthesized.
message
- The info message. This parameter is required.public void addMetadata(java.lang.String type, java.lang.Object data, java.lang.Object fromFunction)
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.
type
- a string denoting the type of metadata. This parameter is required.data
- the value of the metadata (can be a Token). This parameter is required.fromFunction
- a function under which to restrict the metadata entry's stack trace (defaults to this.addMetadata).public void addMetadata(java.lang.String type, java.lang.Object data)
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.
type
- a string denoting the type of metadata. This parameter is required.data
- the value of the metadata (can be a Token). This parameter is required.public void addValidation(software.constructs.IValidation validation)
validation
- This parameter is required.@Deprecated public void addWarning(java.lang.String message)
The toolkit will display the warning when an app is synthesized, or fail if run in --strict mode.
message
- The warning message. This parameter is required.@Deprecated public void applyAspect(IAspect aspect)
aspect
- This parameter is required.public java.util.List<IConstruct> findAll(ConstructOrder order)
order
- public java.util.List<IConstruct> findAll()
public IConstruct findChild(java.lang.String id)
Throws an error if the child is not found.
id
- Identifier of direct child. This parameter is required.public void setContext(java.lang.String key, java.lang.Object value)
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.
key
- The context key. This parameter is required.value
- The context value. This parameter is required.public IConstruct tryFindChild(java.lang.String id)
id
- Identifier of direct child. This parameter is required.public java.lang.Object tryGetContext(java.lang.String key)
Context is usually initialized at the root, but can be overridden at any point in the tree.
key
- The context key. This parameter is required.public java.lang.Boolean tryRemoveChild(java.lang.String childName)
childName
- This parameter is required.public java.lang.String getAddr()
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 refactorings 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 addreess.
Example value: c83a2846e506bcc5f10682b564084bca2d275709ee
public java.util.List<IConstruct> getChildren()
public java.util.List<Dependency> getDependencies()
public java.lang.String getId()
This is a a scope-unique id. To obtain an app-unique id for this construct, use uniqueId
.
public java.lang.Boolean getLocked()
@Deprecated public java.util.List<MetadataEntry> getMetadata()
public java.util.List<software.constructs.MetadataEntry> getMetadataEntry()
This can be used, for example, to implement support for deprecation notices, source mapping, etc.
public java.lang.String getPath()
Components are separated by '/'.
public IConstruct getRoot()
public java.util.List<IConstruct> getScopes()
@Deprecated public java.lang.String getUniqueId()
Includes all components of the tree.
public IConstruct getScope()
The value is undefined
at the root of the construct scope tree.
public IConstruct getDefaultChild()
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.
public void setDefaultChild(IConstruct value)
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.