Class HeteroDescribableConfigurator<T extends Describable<T>>
- java.lang.Object
-
- io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator<T>
-
- All Implemented Interfaces:
Configurator<T>
- Direct Known Subclasses:
LabelAtomPropertyConfigurator
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public class HeteroDescribableConfigurator<T extends Describable<T>> extends Object implements Configurator<T>
Configurator
that works withDescribable
subtype as atarget
.The configuration object will be specify the 'short name' which we use to resolve to a specific subtype of
target
. For example, iftarget
isSecurityRealm
and the short name is 'local', we resolve toHudsonPrivateSecurityRealm
(because it hasSymbol
annotation that specifies that name.The corresponding
Configurator
will be then invoked to configure the chosen subtype.- Author:
- Nicolas De Loof
-
-
Constructor Summary
Constructors Constructor Description HeteroDescribableConfigurator(Class<T> clazz)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
check(CNode config, ConfigurationContext context)
Run the same logic asConfigurator.configure(CNode, ConfigurationContext)
in dry-run mode.T
configure(CNode config, ConfigurationContext context)
Configures/creates a Jenkins object based on a tree.Set<Attribute<T,?>>
describe()
Determine the list of Attribute available for configuration of the managed component.CNode
describe(T instance, ConfigurationContext context)
Describe a component as a Configuration NodesCNode
to be exported as yaml.List<Configurator<T>>
getConfigurators(ConfigurationContext context)
Map<String,Class<T>>
getImplementors()
Class<T>
getTarget()
Target type this configurator can handle.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.jenkins.plugins.casc.Configurator
canConfigure, describeStructure, getAttributes, getDisplayName, getImplementedAPI, getName, getNames
-
-
-
-
Method Detail
-
getTarget
public Class<T> getTarget()
Description copied from interface:Configurator
Target type this configurator can handle.- Specified by:
getTarget
in interfaceConfigurator<T extends Describable<T>>
-
getConfigurators
@NonNull public List<Configurator<T>> getConfigurators(ConfigurationContext context)
- Specified by:
getConfigurators
in interfaceConfigurator<T extends Describable<T>>
- Returns:
- list of
Configurator
s to be considered so one can fully configure this component. Typically, configurator for an abstract extension point will return Configurators for available implementations.
-
configure
@NonNull public T configure(CNode config, ConfigurationContext context)
Description copied from interface:Configurator
Configures/creates a Jenkins object based on a tree.- Specified by:
configure
in interfaceConfigurator<T extends Describable<T>>
- Parameters:
config
- Map/List/primitive objects (think YAML) that represents the configuration from which a Jenkins object is configured.- Returns:
- Fully configured Jenkins object that results from this configuration. if no new objects got created, but some existing objects may have been modified, return updated target object.
-
check
public T check(CNode config, ConfigurationContext context)
Description copied from interface:Configurator
Run the same logic asConfigurator.configure(CNode, ConfigurationContext)
in dry-run mode. Used to verify configuration is fine before being actually applied to a live jenkins controller.- Specified by:
check
in interfaceConfigurator<T extends Describable<T>>
-
describe
@NonNull public Set<Attribute<T,?>> describe()
Description copied from interface:Configurator
Determine the list of Attribute available for configuration of the managed component.- Specified by:
describe
in interfaceConfigurator<T extends Describable<T>>
- Returns:
- A set of
Attribute
s that describes this object
-
describe
@CheckForNull public CNode describe(T instance, ConfigurationContext context)
Description copied from interface:Configurator
Describe a component as a Configuration NodesCNode
to be exported as yaml. Only export attributes which are not set to default value.- Specified by:
describe
in interfaceConfigurator<T extends Describable<T>>
-
-