Skip to main content
Includes API for attaching annotations such as warning messages to constructs.

Methods

NameDescription
addErrorAdds an { “error”: < message > } metadata entry to this construct.
addInfoAdds an info metadata entry to this construct.
addWarningAdds a warning metadata entry to this construct.

addError

public void addError(java.lang.String message)
Adds an { “error”: < message > } metadata entry to this construct. The toolkit will fail synthesis when errors are reported.

messageRequired

  • Type: java.lang.String
The error message.

addInfo

public void addInfo(java.lang.String message)
Adds an info metadata entry to this construct. The CLI will display the info message when apps are synthesized.

messageRequired

  • Type: java.lang.String
The info message.

addWarning

public void addWarning(java.lang.String message)
Adds a warning metadata entry to this construct. The CLI will display the warning when an app is synthesized. In a future release the CLI might introduce a —strict flag which will then fail the synthesis if it encounters a warning.

messageRequired

  • Type: java.lang.String
The warning message.

Static Functions

NameDescription
ofReturns the annotations API for a construct scope.

of

import io.cdktn.cdktn.Annotations;

Annotations.of(IConstruct scope)
Returns the annotations API for a construct scope.

scopeRequired

  • Type: software.constructs.IConstruct
The scope.