Class PluginContext.Builder

java.lang.Object
software.amazon.smithy.build.PluginContext.Builder
All Implemented Interfaces:
software.amazon.smithy.utils.SmithyBuilder<PluginContext>
Enclosing class:
PluginContext

public static final class PluginContext.Builder extends Object implements software.amazon.smithy.utils.SmithyBuilder<PluginContext>
Builds a PluginContext.
  • Method Details

    • build

      public PluginContext build()
      Specified by:
      build in interface software.amazon.smithy.utils.SmithyBuilder<PluginContext>
    • fileManifest

      public PluginContext.Builder fileManifest(FileManifest fileManifest)
      Sets the required FileManifest to use in the plugin.
      Parameters:
      fileManifest - FileManifest to use.
      Returns:
      Returns the builder.
    • model

      public PluginContext.Builder model(software.amazon.smithy.model.Model model)
      Sets the required model that is being built.
      Parameters:
      model - Model to set.
      Returns:
      Returns the builder.
    • projection

      public PluginContext.Builder projection(String name, ProjectionConfig projection)
      Sets the projection that the plugin belongs to.
      Parameters:
      name - Name of the projection.
      projection - ProjectionConfig to set.
      Returns:
      Returns the builder.
    • originalModel

      public PluginContext.Builder originalModel(software.amazon.smithy.model.Model originalModel)
      Sets the model that is being built before it was transformed in the projection.
      Parameters:
      originalModel - Original Model to set.
      Returns:
      Returns the builder.
    • events

      public PluginContext.Builder events(List<software.amazon.smithy.model.validation.ValidationEvent> events)
      Sets the validation events that occurred after projecting the model.
      Parameters:
      events - Validation events to set.
      Returns:
      Returns the builder.
    • settings

      public PluginContext.Builder settings(software.amazon.smithy.model.node.ObjectNode settings)
      Sets the settings of the plugin.
      Parameters:
      settings - Settings to set.
      Returns:
      Returns the builder.
    • pluginClassLoader

      public PluginContext.Builder pluginClassLoader(ClassLoader pluginClassLoader)
      Sets a ClassLoader that should be used by build plugins when loading services.
      Parameters:
      pluginClassLoader - ClassLoader to use in build plugins.
      Returns:
      Retruns the builder.
    • sources

      public PluginContext.Builder sources(Collection<Path> sources)
      Replaces the path to models that are considered "source" models of the package being built.
      Parameters:
      sources - Source models to set.
      Returns:
      Returns the builder.
    • artifactName

      public PluginContext.Builder artifactName(String artifactName)
      Set a custom artifact name used to change the output directory of a plugin.

      An artifact name is useful when running plugins like "run" or when running a plugin multiple times in a single projection.

      Parameters:
      artifactName - Custom artifact name to set.
      Returns:
      Returns the builder.