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 CfnConverterclassLoader(java.lang.ClassLoader classLoader)Sets aClassLoaderto use to discoverSmithy2CfnExtensionservice providers through SPI.CfnConverterconfig(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@cfnResourcetrait to JSON/Node representations of CloudFormation Resource Schemas using the given Smithy model.static CfnConvertercreate()CfnConfiggetConfig()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 aClassLoaderto use to discoverSmithy2CfnExtensionservice providers through SPI.The
CfnConverterwill 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@cfnResourcetrait 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.
-
-