Class CfnConverter
java.lang.Object
software.amazon.smithy.aws.cloudformation.schema.fromsmithy.CfnConverter
-
Method Summary
Modifier and TypeMethodDescriptionclassLoader
(ClassLoader classLoader) Sets aClassLoader
to use to discoverSmithy2CfnExtension
service providers through SPI.Set the CloudFormation configuration settings.Converts the annotated resources in the Smithy model to CloudFormation Resource Schemas.convertToNodes
(Model model) Converts resource shapes annotated with the@cfnResource
trait to JSON/Node representations of CloudFormation Resource Schemas using the given Smithy model.static CfnConverter
create()
Get the CloudFormation configuration settings.
-
Method Details
-
create
-
getConfig
Get the CloudFormation configuration settings.- Returns:
- Returns the config object.
-
config
Set the CloudFormation configuration settings.- Parameters:
config
- Config object to set.- Returns:
- Returns the converter.
-
classLoader
Sets aClassLoader
to use to discoverSmithy2CfnExtension
service providers through SPI.The
CfnConverter
will use its own ClassLoader by default.- Parameters:
classLoader
- ClassLoader to use.- Returns:
- Returns the converter.
-
convertToNodes
Converts resource shapes annotated with the@cfnResource
trait to JSON/Node representations of CloudFormation Resource Schemas using the given Smithy model.The result of this method may differ from the result of calling
ResourceSchema.toNode()
because this method will pass the Node representation of the ResourceSchema through theCfnMapper.updateNode(software.amazon.smithy.aws.cloudformation.schema.fromsmithy.Context, software.amazon.smithy.aws.cloudformation.schema.model.ResourceSchema, software.amazon.smithy.model.node.ObjectNode)
method of each registeredCfnMapper
.- Parameters:
model
- Smithy model to convert.- Returns:
- A map of CloudFormation resource type names to their converted schema nodes.
-
convert
Converts the annotated resources in the Smithy model to CloudFormation Resource Schemas.- Parameters:
model
- Smithy model containing resources to convert.- Returns:
- Returns the converted resources.
-