Class UniqueItemDecoratorIntegration
- java.lang.Object
-
- software.amazon.smithy.traitcodegen.integrations.uniqueitems.UniqueItemDecoratorIntegration
-
- All Implemented Interfaces:
SmithyIntegration<TraitCodegenSettings,TraitCodegenWriter,TraitCodegenContext>
,TraitCodegenIntegration
public class UniqueItemDecoratorIntegration extends java.lang.Object implements TraitCodegenIntegration
Handles type conversions associated with the use of theUniqueItems
trait.Lists shapes and list members with the UniqueItems trait should be represented by a
Set
rather than a list.
-
-
Constructor Summary
Constructors Constructor Description UniqueItemDecoratorIntegration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SymbolProvider
decorateSymbolProvider(Model model, TraitCodegenSettings settings, SymbolProvider symbolProvider)
Updates theSymbolProvider
used when generating code.java.lang.String
name()
Gets the name of the integration.byte
priority()
Gets the priority ordering relative to the topologically ordered integration graph determined bySmithyIntegration.runBefore()
andSmithyIntegration.runAfter()
.java.util.List<java.lang.String>
runAfter()
Gets the name of the integrations that this integration must come after.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface software.amazon.smithy.codegen.core.SmithyIntegration
configure, customize, interceptors, preprocessModel, runBefore
-
-
-
-
Method Detail
-
name
public java.lang.String name()
Description copied from interface:SmithyIntegration
Gets the name of the integration.This name is referred to when ordering the graph of integrations. The name defaults to the canonical class name if not overridden.
- Specified by:
name
in interfaceSmithyIntegration<TraitCodegenSettings,TraitCodegenWriter,TraitCodegenContext>
- Returns:
- Returns the integration name.
-
runAfter
public java.util.List<java.lang.String> runAfter()
Description copied from interface:SmithyIntegration
Gets the name of the integrations that this integration must come after.Dependencies are soft. Dependencies on integration names that cannot be found log a warning and are ignored.
- Specified by:
runAfter
in interfaceSmithyIntegration<TraitCodegenSettings,TraitCodegenWriter,TraitCodegenContext>
- Returns:
- Returns the integration names this must come after.
-
priority
public byte priority()
Description copied from interface:SmithyIntegration
Gets the priority ordering relative to the topologically ordered integration graph determined bySmithyIntegration.runBefore()
andSmithyIntegration.runAfter()
.Higher numbers come before lower numbers.
When ordering, implementations must not allow cycles, and no two integrations may have the same name.
- Specified by:
priority
in interfaceSmithyIntegration<TraitCodegenSettings,TraitCodegenWriter,TraitCodegenContext>
- Returns:
- Returns the priority order.
-
decorateSymbolProvider
public SymbolProvider decorateSymbolProvider(Model model, TraitCodegenSettings settings, SymbolProvider symbolProvider)
Description copied from interface:SmithyIntegration
Updates theSymbolProvider
used when generating code.This can be used to customize the names of shapes, the package that code is generated into, add dependencies, add imports, etc.
By default, this method will return the given
symbolProvider
as-is.This integration method should be called only after
SmithyIntegration.preprocessModel(software.amazon.smithy.model.Model, S)
.- Specified by:
decorateSymbolProvider
in interfaceSmithyIntegration<TraitCodegenSettings,TraitCodegenWriter,TraitCodegenContext>
- Parameters:
model
- Model being generated.settings
- Settings used to generate.symbolProvider
- The originalSymbolProvider
.- Returns:
- The decorated
SymbolProvider
.
-
-