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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
execute
(PluginContext context) Executes the plugin, creating any number of artifacts.protected abstract void
executeWithConfig
(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, wait
Methods 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
configType
class must be a public POJO with a public, zero-arg constructor, getters, and setters. If the POJO has a public staticfromNode
method, it will be invoked and is expected to deserialize the Node. If the POJO has a public staticbuilder
method, it will be invoked, setters will be called on the builder POJO, and finally the result of calling thebuild
method 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:SmithyBuildPlugin
Executes the plugin, creating any number of artifacts.- Specified by:
execute
in 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.
-