Class CfnConverter
- java.lang.Object
-
- software.amazon.smithy.aws.cloudformation.schema.fromsmithy.CfnConverter
-
public final class CfnConverter extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CfnConverter
classLoader(java.lang.ClassLoader classLoader)
Sets aClassLoader
to use to discoverSmithy2CfnExtension
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.
-
-
-
Method Detail
-
create
public static CfnConverter create()
-
getConfig
public CfnConfig getConfig()
Get the CloudFormation configuration settings.- Returns:
- Returns the config object.
-
config
public CfnConverter config(CfnConfig config)
Set the CloudFormation configuration settings.- Parameters:
config
- Config object to set.- Returns:
- Returns the converter.
-
classLoader
public CfnConverter classLoader(java.lang.ClassLoader 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
public 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.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
public java.util.List<ResourceSchema> convert(Model model)
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.
-
-