Class CoreIntegration
- All Implemented Interfaces:
SmithyIntegration<TraitCodegenSettings,,TraitCodegenWriter, TraitCodegenContext> TraitCodegenIntegration
This integration applies no built-in's, but decorates the Symbol provider to replace a
shape symbol with a trait symbol definition if the trait has the
TraitDefinition trait applied.
Trait symbols are named <ShapeName>Trait and always have a definition file.
This integration runs after all other integrations have finished to ensure that
any other type decorators and integrations have already been applied before creating any Trait
definitions from the resulting type.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondecorateSymbolProvider(Model model, TraitCodegenSettings settings, SymbolProvider symbolProvider) Updates theSymbolProviderused when generating code.List<? extends CodeInterceptor<? extends CodeSection,TraitCodegenWriter>> interceptors(TraitCodegenContext codegenContext) Gets a list ofCodeInterceptors to register with theAbstractCodeWriters created by the code generator.name()Gets the name of the integration.bytepriority()Gets the priority ordering relative to the topologically ordered integration graph determined bySmithyIntegration.runBefore()andSmithyIntegration.runAfter().Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.smithy.codegen.core.SmithyIntegration
configure, customize, preprocessModel, runAfter, runBefore
-
Constructor Details
-
CoreIntegration
public CoreIntegration()
-
-
Method Details
-
name
Description copied from interface:SmithyIntegrationGets 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:
namein interfaceSmithyIntegration<TraitCodegenSettings,TraitCodegenWriter, TraitCodegenContext> - Returns:
- Returns the integration name.
-
priority
public byte priority()Description copied from interface:SmithyIntegrationGets 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:
priorityin interfaceSmithyIntegration<TraitCodegenSettings,TraitCodegenWriter, TraitCodegenContext> - Returns:
- Returns the priority order.
-
decorateSymbolProvider
public SymbolProvider decorateSymbolProvider(Model model, TraitCodegenSettings settings, SymbolProvider symbolProvider) Description copied from interface:SmithyIntegrationUpdates theSymbolProviderused 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
symbolProvideras-is.This integration method should be called only after
SmithyIntegration.preprocessModel(software.amazon.smithy.model.Model, S).- Specified by:
decorateSymbolProviderin interfaceSmithyIntegration<TraitCodegenSettings,TraitCodegenWriter, TraitCodegenContext> - Parameters:
model- Model being generated.settings- Settings used to generate.symbolProvider- The originalSymbolProvider.- Returns:
- The decorated
SymbolProvider.
-
interceptors
public List<? extends CodeInterceptor<? extends CodeSection,TraitCodegenWriter>> interceptors(TraitCodegenContext codegenContext) Description copied from interface:SmithyIntegrationGets a list ofCodeInterceptors to register with theAbstractCodeWriters created by the code generator.This integration method should be called only after
SmithyIntegration.preprocessModel(software.amazon.smithy.model.Model, S)andSmithyIntegration.decorateSymbolProvider(software.amazon.smithy.model.Model, S, software.amazon.smithy.codegen.core.SymbolProvider).- Specified by:
interceptorsin interfaceSmithyIntegration<TraitCodegenSettings,TraitCodegenWriter, TraitCodegenContext> - Parameters:
codegenContext- Code generation context that can be queried when creating interceptors.- Returns:
- Returns the list of
CodeInterceptors.
-