@Generated(value="jsii-pacmak/1.14.0 (build 729554b)", date="2020-11-02T06:18:16.499Z") @Stability(value=Stable) public class Node extends software.amazon.jsii.JsiiObject
Modifier and Type | Field and Description |
---|---|
static String |
PATH_SEP
Separator used to delimit construct path components.
|
Modifier | Constructor and Description |
---|---|
|
Node(Construct host,
IConstruct scope,
String id) |
protected |
Node(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Node(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
void |
addDependency(IConstruct... dependencies)
Add an ordering dependency on another Construct.
|
void |
addError(String message)
Adds an { "error":
|
void |
addInfo(String message)
Adds a { "info":
|
void |
addMetadata(String type,
Object data)
Adds a metadata entry to this construct.
|
void |
addMetadata(String type,
Object data,
Object fromFunction)
Adds a metadata entry to this construct.
|
void |
addValidation(IValidation validation)
Adds a validation to this construct.
|
void |
addWarning(String message)
Adds a { "warning":
|
void |
applyAspect(IAspect aspect)
Applies the aspect to this Constructs node.
|
List<IConstruct> |
findAll()
Return this construct and all of its children in the given order.
|
List<IConstruct> |
findAll(ConstructOrder order)
Return this construct and all of its children in the given order.
|
IConstruct |
findChild(String id)
Return a direct child by id.
|
String |
getAddr()
Returns an opaque tree-unique address for this construct.
|
List<IConstruct> |
getChildren()
All direct children of this construct.
|
IConstruct |
getDefaultChild()
Returns the child construct that has the id `Default` or `Resource"`.
|
List<Dependency> |
getDependencies()
Return all dependencies registered on this node or any of its children.
|
String |
getId()
The id of this construct within the current scope.
|
Boolean |
getLocked()
Returns true if this construct or the scopes in which it is defined are locked.
|
List<MetadataEntry> |
getMetadata()
An immutable array of metadata objects associated with this construct.
|
String |
getPath()
The full, absolute path of this construct in the tree.
|
IConstruct |
getRoot()
Returns the root of the construct tree.
|
IConstruct |
getScope()
Returns the scope in which this construct is defined.
|
List<IConstruct> |
getScopes()
All parent scopes of this construct.
|
String |
getUniqueId()
Deprecated.
please avoid using this property and use `uid` instead. This
algorithm uses MD5, which is not FIPS-complient and also excludes the
identity of the root construct from the calculation.
|
static Node |
of(IConstruct construct)
Returns the node associated with a construct.
|
void |
prepare()
Invokes "prepare" on all constructs (depth-first, post-order) in the tree under `node`.
|
void |
setContext(String key,
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"`.
|
void |
synthesize(SynthesisOptions options)
Synthesizes a CloudAssembly from a construct tree.
|
IConstruct |
tryFindChild(String id)
Return a direct child by id, or undefined.
|
Object |
tryGetContext(String key)
Retrieves a value from tree context.
|
Boolean |
tryRemoveChild(String childName)
(experimental) Remove the child with the given name, if present.
|
List<ValidationError> |
validate()
Validates tree (depth-first, pre-order) and returns the list of all errors.
|
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
@Stability(value=Stable) public static final String PATH_SEP
protected Node(software.amazon.jsii.JsiiObjectRef objRef)
protected Node(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable) public Node(@NotNull Construct host, @NotNull IConstruct scope, @NotNull String id)
host
- This parameter is required.scope
- This parameter is required.id
- This parameter is required.@Stability(value=Stable) @NotNull public static Node of(@NotNull IConstruct construct)
construct
- the construct. This parameter is required.@Stability(value=Stable) public void addDependency(@NotNull IConstruct... dependencies)
All constructs in the dependency's scope will be deployed before any construct in this construct's scope.
dependencies
- This parameter is required.@Stability(value=Stable) public void addError(@NotNull String message)
The toolkit will fail synthesis when errors are reported.
message
- The error message. This parameter is required.@Stability(value=Stable) public void addInfo(@NotNull String message)
The toolkit will display the info message when apps are synthesized.
message
- The info message. This parameter is required.@Stability(value=Stable) public void addMetadata(@NotNull String type, @NotNull Object data, @Nullable 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).@Stability(value=Stable) public void addMetadata(@NotNull String type, @NotNull 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.@Stability(value=Stable) public void addValidation(@NotNull IValidation validation)
When node.validate()
is called, the validate()
method will be called on
all validations and all errors will be returned.
validation
- This parameter is required.@Stability(value=Stable) public void addWarning(@NotNull 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.@Stability(value=Stable) public void applyAspect(@NotNull IAspect aspect)
aspect
- This parameter is required.@Stability(value=Stable) @NotNull public List<IConstruct> findAll(@Nullable ConstructOrder order)
order
- @Stability(value=Stable) @NotNull public List<IConstruct> findAll()
@Stability(value=Stable) @NotNull public IConstruct findChild(@NotNull String id)
Throws an error if the child is not found.
id
- Identifier of direct child. This parameter is required.@Stability(value=Stable) public void prepare()
@Stability(value=Stable) public void setContext(@NotNull String key, @NotNull 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.@Stability(value=Stable) public void synthesize(@NotNull SynthesisOptions options)
options
- Synthesis options. This parameter is required.@Stability(value=Stable) @Nullable public IConstruct tryFindChild(@NotNull String id)
id
- Identifier of direct child. This parameter is required.@Stability(value=Stable) @NotNull public Object tryGetContext(@NotNull 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.@Stability(value=Experimental) @NotNull public Boolean tryRemoveChild(@NotNull String childName)
childName
- This parameter is required.@Stability(value=Stable) @NotNull public List<ValidationError> validate()
An empty list indicates that there are no errors.
@Stability(value=Stable) @NotNull public 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:
// Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826 c83a2846e506bcc5f10682b564084bca2d275709ee;
@Stability(value=Stable) @NotNull public List<IConstruct> getChildren()
@Stability(value=Stable) @NotNull public List<Dependency> getDependencies()
@Stability(value=Stable) @NotNull public String getId()
This is a a scope-unique id. To obtain an app-unique id for this construct, use uniqueId
.
@Stability(value=Stable) @NotNull public Boolean getLocked()
@Stability(value=Stable) @NotNull public List<MetadataEntry> getMetadata()
This can be used, for example, to implement support for deprecation notices, source mapping, etc.
@Stability(value=Stable) @NotNull public String getPath()
Components are separated by '/'.
@Stability(value=Stable) @NotNull public IConstruct getRoot()
@Stability(value=Stable) @NotNull public List<IConstruct> getScopes()
@Stability(value=Deprecated) @Deprecated @NotNull public String getUniqueId()
Includes all components of the tree.
@Stability(value=Stable) @Nullable public IConstruct getScope()
The value is undefined
at the root of the construct scope tree.
@Stability(value=Stable) @Nullable 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.
@Stability(value=Stable) public void setDefaultChild(@Nullable 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.
Copyright © 2020. All rights reserved.