public final class SmithyIdlModelSerializer
extends java.lang.Object
Model
into a set of Smithy IDL files.Modifier and Type | Class and Description |
---|---|
static class |
SmithyIdlModelSerializer.Builder
Builder used to create
SmithyIdlModelSerializer . |
Modifier and Type | Method and Description |
---|---|
static SmithyIdlModelSerializer.Builder |
builder() |
static java.nio.file.Path |
placeShapesByNamespace(Shape shape)
Sorts shapes into files based on their namespace, where each file is named {namespace}.smithy.
|
java.util.Map<java.nio.file.Path,java.lang.String> |
serialize(Model model)
Serializes a
Model into a set of Smithy IDL files. |
public java.util.Map<java.nio.file.Path,java.lang.String> serialize(Model model)
Model
into a set of Smithy IDL files.
The output is a mapping
By default the paths are relative paths where each namespace is given its own file in the form "namespace.smithy". This is configurable via the shape placer, which can place shapes into absolute paths.
If the model contains no shapes, or all shapes are filtered out, then a single path "metadata.smithy" will be present. This will contain only any defined metadata.
model
- The model to serialize.public static SmithyIdlModelSerializer.Builder builder()
SmithyIdlModelSerializer
public static java.nio.file.Path placeShapesByNamespace(Shape shape)
shape
- The shape to assign a file to.