Class SelfConfigurator
- java.lang.Object
-
- io.jenkins.plugins.casc.BaseConfigurator<ConfigurationContext>
-
- io.jenkins.plugins.casc.impl.configurators.SelfConfigurator
-
- All Implemented Interfaces:
Configurator<ConfigurationContext>
,RootElementConfigurator<ConfigurationContext>
@Extension(ordinal=1.7976931348623157E308) @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public class SelfConfigurator extends BaseConfigurator<ConfigurationContext> implements RootElementConfigurator<ConfigurationContext>
- Author:
- Nicolas De Loof
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.jenkins.plugins.casc.BaseConfigurator
BaseConfigurator.TypePair
-
-
Constructor Summary
Constructors Constructor Description SelfConfigurator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
configure(Mapping config, ConfigurationContext instance, boolean dryrun, ConfigurationContext context)
Run configuration process on the target instanceCNode
describe(ConfigurationContext instance, ConfigurationContext context)
Describe a component as a Configuration NodesCNode
to be exported as yaml.String
getName()
Get a configurator name.Class<ConfigurationContext>
getTarget()
Target type this configurator can handle.ConfigurationContext
getTargetComponent(ConfigurationContext context)
Retrieve the target component managed by this RootElementConfiguratorprotected ConfigurationContext
instance(Mapping mapping, ConfigurationContext context)
Build or identify the target component this configurator has to handle based on the provided configuration node.-
Methods inherited from class io.jenkins.plugins.casc.BaseConfigurator
check, compare, configure, createAttribute, describe, equals, exclusions, handleUnknown, hashCode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.jenkins.plugins.casc.Configurator
canConfigure, check, configure, describe, describeStructure, getAttributes, getConfigurators, getDisplayName, getImplementedAPI, getNames
-
Methods inherited from interface io.jenkins.plugins.casc.RootElementConfigurator
isRootElement
-
-
-
-
Method Detail
-
getName
@NonNull public String getName()
Description copied from interface:Configurator
Get a configurator name. This should return the default name for the configurator, used for exporting yaml seeConfigurator.getNames()
for all possible names which will be considered when configuring.- Specified by:
getName
in interfaceConfigurator<ConfigurationContext>
- Returns:
- short name for this component when used in a configuration.yaml file
-
getTarget
public Class<ConfigurationContext> getTarget()
Description copied from interface:Configurator
Target type this configurator can handle.- Specified by:
getTarget
in interfaceConfigurator<ConfigurationContext>
-
getTargetComponent
public ConfigurationContext getTargetComponent(ConfigurationContext context)
Description copied from interface:RootElementConfigurator
Retrieve the target component managed by this RootElementConfigurator- Specified by:
getTargetComponent
in interfaceRootElementConfigurator<ConfigurationContext>
- Returns:
-
instance
protected ConfigurationContext instance(Mapping mapping, ConfigurationContext context)
Description copied from class:BaseConfigurator
Build or identify the target component this configurator has to handle based on the provided configuration node.- Specified by:
instance
in classBaseConfigurator<ConfigurationContext>
- Parameters:
mapping
- configuration for target component. Implementation may consume some entries to create a fresh new instance.- Returns:
- instance to be configured, but not yet fully configured, see
BaseConfigurator.configure(Mapping, Object, boolean, ConfigurationContext)
-
configure
protected void configure(Mapping config, ConfigurationContext instance, boolean dryrun, ConfigurationContext context) throws ConfiguratorException
Description copied from class:BaseConfigurator
Run configuration process on the target instance- Overrides:
configure
in classBaseConfigurator<ConfigurationContext>
- Parameters:
config
- configuration to apply. Can be partial ifBaseConfigurator.instance(Mapping, ConfigurationContext)
did already used some entriesinstance
- target instance to configuredryrun
- only check configuration is valid regarding target component. Don't actually apply changes to jenkins controller instance- Throws:
ConfiguratorException
- something went wrong...
-
describe
@CheckForNull public CNode describe(ConfigurationContext instance, ConfigurationContext context) throws Exception
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<ConfigurationContext>
- Throws:
Exception
-
-