Package software.amazon.smithy.build
Class TransformContext
java.lang.Object
software.amazon.smithy.build.TransformContext
- All Implemented Interfaces:
software.amazon.smithy.utils.ToSmithyBuilder<TransformContext>
public final class TransformContext
extends Object
implements software.amazon.smithy.utils.ToSmithyBuilder<TransformContext>
Context object used when applying a
ProjectionTransformer
.
Implementer's note: A context object is used to allow contextual information provided to projection transforms to evolve over time.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic TransformContext.Builder
builder()
software.amazon.smithy.model.Model
getModel()
Gets the model to transform.Optional<software.amazon.smithy.model.Model>
Get the original model before applying the projection.List<software.amazon.smithy.model.validation.ValidationEvent>
Gets an immutable list ofValidationEvent
s that were encountered when loading the source model.Gets the name of the projection being applied.software.amazon.smithy.model.node.ObjectNode
Gets the arguments object of the transform.Gets the source models, or models that are considered the subject of the build.software.amazon.smithy.model.transform.ModelTransformer
Gets theModelTransformer
that has been configured to aid in the transformation.
-
Method Details
-
builder
- Returns:
- Returns a TransformContext builder.
-
toBuilder
- Specified by:
toBuilder
in interfacesoftware.amazon.smithy.utils.ToSmithyBuilder<TransformContext>
-
getSettings
public software.amazon.smithy.model.node.ObjectNode getSettings()Gets the arguments object of the transform.- Returns:
- Returns the transformer arguments.
-
getModel
public software.amazon.smithy.model.Model getModel()Gets the model to transform.- Returns:
- Returns the model to transform.
-
getOriginalModel
Get the original model before applying the projection.- Returns:
- The optionally provided original model.
-
getSources
Gets the source models, or models that are considered the subject of the build.This does not return an exhaustive set of model paths! There are typically two kinds of models that are added to a build: source models and discovered models. Discovered models are someone else's models. Source models are the models owned by the package being built.
- Returns:
- Returns the source models.
-
getProjectionName
Gets the name of the projection being applied.If no projection could be found, "source" is assumed.
- Returns:
- Returns the explicit or assumed projection name.
-
getTransformer
public software.amazon.smithy.model.transform.ModelTransformer getTransformer()Gets theModelTransformer
that has been configured to aid in the transformation.- Returns:
- Returns the model transformer.
-
getOriginalModelValidationEvents
public List<software.amazon.smithy.model.validation.ValidationEvent> getOriginalModelValidationEvents()Gets an immutable list ofValidationEvent
s that were encountered when loading the source model.- Returns:
- Returns the encountered validation events.
-