Class Directive<S>
- Type Parameters:
S- Settings object used to configure code generation.
- Direct Known Subclasses:
ContextualDirective,CreateContextDirective,CreateSymbolProviderDirective
DirectedCodegen implementation.-
Method Summary
Modifier and TypeMethodDescriptionReturns a map of the shapes being generated.final ServiceShapeGets the service being generated, failing if there is none.Gets the renames that apply to the shapes being generated.final Optional<ServiceShape>Gets the service being generated, if code generation is driven by a service.Gets the ID of the shape closure being generated, if code generation is driven by a shape closure.final Modelmodel()Gets a set of all operation shapes being generated, sorted by name.final ServiceShapeservice()Deprecated.final Ssettings()
-
Method Details
-
model
- Returns:
- Gets the model being code generated.
-
settings
- Returns:
- Gets code generation settings.
-
service
Deprecated.UsegetService()to safely handle the absence of a service when code generation is driven by a shape closure.Gets the service being generated.- Returns:
- Gets the service being generated.
- Throws:
CodegenException- if there is no service because code generation is driven by a shape closure rather than a service.
-
getService
Gets the service being generated, if code generation is driven by a service.- Returns:
- Returns the optional service being generated.
-
expectService
Gets the service being generated, failing if there is none.- Returns:
- Returns the service being generated.
- Throws:
CodegenException- if there is no service because code generation is driven by a shape closure rather than a service.
-
getShapeClosureId
Gets the ID of the shape closure being generated, if code generation is driven by a shape closure.- Returns:
- Returns the optional shape closure ID being generated.
-
getRenames
Gets the renames that apply to the shapes being generated.The renames mirror the generated set: when a shape closure is present (closure or combined mode) these are the closure's renames, otherwise they are the primary service's renames. Each key is the id of a shape being generated and each value is the name, without a namespace, to use for that shape.
- Returns:
- Returns a map of shape id to replacement name, empty if none apply.
-
connectedShapes
Returns a map of the shapes being generated.When driven by a service, these are the shapes connected to the service. When driven by a shape closure, these are the shapes in that closure. When only data shapes are being generated, service, resource, and operation shapes are excluded since they are not generated.
- Returns:
- Returns a map of shapes being generated.
-
operations
Gets a set of all operation shapes being generated, sorted by name.When driven by a service, this includes operations contained in resources in the closure of the service. When driven by a shape closure, this is the set of operation shapes in the closure. When only data shapes are being generated, no operations are generated and this is always empty.
- Returns:
- Returns all sorted operations being generated.
-
getService()to safely handle the absence of a service when code generation is driven by a shape closure.