Class ConfigurableSmithyBuildPlugin<T>
- Type Parameters:
T- The configuration setting type (e.g., a POJO).
- All Implemented Interfaces:
SmithyBuildPlugin
T.
This class will automatically deserialize the given Node
value in the T and invoke executeWithConfig(PluginContext, Object)
with the deserialized configuration of type T.
If your build plugin requires configuration, then you typically should just extend this class.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute(PluginContext context) Executes the plugin, creating any number of artifacts.protected abstract voidexecuteWithConfig(PluginContext context, T config) Executes the plugin using the deserialized configuration object.Gets the configuration class type.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.smithy.build.SmithyBuildPlugin
getName, isSerial, requiresValidModel
-
Constructor Details
-
ConfigurableSmithyBuildPlugin
public ConfigurableSmithyBuildPlugin()
-
-
Method Details
-
getConfigType
Gets the configuration class type.The referenced
configTypeclass must be a public POJO with a public, zero-arg constructor, getters, and setters. If the POJO has a public staticfromNodemethod, it will be invoked and is expected to deserialize the Node. If the POJO has a public staticbuildermethod, it will be invoked, setters will be called on the builder POJO, and finally the result of calling thebuildmethod is used as the configuration type. Finally, the deserializer will attempt to create the type and call setters on it that correspond to property names.- Returns:
- Returns the configuration class (a POJO with setters/getters).
-
execute
Description copied from interface:SmithyBuildPluginExecutes the plugin, creating any number of artifacts.- Specified by:
executein interfaceSmithyBuildPlugin- Parameters:
context- Plugin context for build execution.
-
executeWithConfig
Executes the plugin using the deserialized configuration object.- Parameters:
context- Plugin context.config- Deserialized configuration object.
-