public final class CfnConverter
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
CfnConverter |
classLoader(java.lang.ClassLoader classLoader)
Sets a
ClassLoader to use to discover Smithy2CfnExtension
service providers through SPI. |
CfnConverter |
config(CfnConfig config)
Set the CloudFormation configuration settings.
|
java.util.List<ResourceSchema> |
convert(Model model)
Converts the annotated resources in the Smithy model to CloudFormation
Resource Schemas.
|
java.util.Map<java.lang.String,ObjectNode> |
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() |
CfnConfig |
getConfig()
Get the CloudFormation configuration settings.
|
public static CfnConverter create()
public CfnConfig getConfig()
public CfnConverter config(CfnConfig config)
config
- Config object to set.public CfnConverter classLoader(java.lang.ClassLoader classLoader)
ClassLoader
to use to discover Smithy2CfnExtension
service providers through SPI.
The CfnConverter
will use its own ClassLoader by default.
classLoader
- ClassLoader to use.public java.util.Map<java.lang.String,ObjectNode> convertToNodes(Model model)
@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 the CfnMapper.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 registered CfnMapper
.
model
- Smithy model to convert.public java.util.List<ResourceSchema> convert(Model model)
model
- Smithy model containing resources to convert.