Package hudson.tools
Class ToolDescriptor<T extends ToolInstallation>
- Direct Known Subclasses:
JDK.DescriptorImpl
,Maven.MavenInstallation.DescriptorImpl
public abstract class ToolDescriptor<T extends ToolInstallation>
extends Descriptor<ToolInstallation>
- Since:
- 1.286
- Author:
- huybrechts
-
Nested Class Summary
Nested classes/interfaces inherited from class hudson.model.Descriptor
Descriptor.FormException, Descriptor.PropertyType, Descriptor.Self
-
Field Summary
Fields inherited from class hudson.model.Descriptor
clazz
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected FormValidation
checkHomeDirectory
(File home) May be overridden to provide tool-specific validation of a tool home directory.boolean
configure
(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject json) Invoked when the global configuration page is submitted.boolean
configure
(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject json) Deprecated.doCheckHome
(File value) Checks if the home directory is valid.doCheckName
(String value) Checks if the tool name is valid.Define the global configuration category the global config of this Descriptor is in.List<? extends ToolInstaller>
Optional list of installers to be configured by default for new tools of this type.Default value forToolInstallation.getProperties()
used in the form binding.T[]
Configured instances ofToolInstallation
s.Lists upToolPropertyDescriptor
s that are applicable to thisToolInstallation
.void
setInstallations
(T... installations) OverwritesToolInstallation
s.Methods inherited from class hudson.model.Descriptor
addHelpFileRedirect, bindJSON, bindJSON, calcAutoCompleteSettings, calcFillSettings, configure, doHelp, doHelp, find, find, findByDescribableClassName, findById, getCheckMethod, getCheckUrl, getConfigFile, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getDisplayName, getGlobalConfigPage, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getRequiredGlobalConfigPagePermission, getStaticHelpUrl, getStaticHelpUrl, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
-
Constructor Details
-
ToolDescriptor
protected ToolDescriptor() -
ToolDescriptor
- Since:
- 2.102
-
-
Method Details
-
getInstallations
Configured instances ofToolInstallation
s.- Returns:
- read-only list of installations; can be empty but never null.
-
setInstallations
OverwritesToolInstallation
s.- Parameters:
installations
- list of installations; can be empty but never null.
-
getPropertyDescriptors
Lists upToolPropertyDescriptor
s that are applicable to thisToolInstallation
. -
getCategory
Description copied from class:Descriptor
Define the global configuration category the global config of this Descriptor is in.- Overrides:
getCategory
in classDescriptor<ToolInstallation>
- Returns:
- never null, always the same value for a given instance of
Descriptor
.
-
getDefaultInstallers
Optional list of installers to be configured by default for new tools of this type. If there are popular versions of the tool available using generic installation techniques, they can be returned here for the user's convenience.- Since:
- 1.305
-
getDefaultProperties
public DescribableList<ToolProperty<?>,ToolPropertyDescriptor> getDefaultProperties() throws IOExceptionDefault value forToolInstallation.getProperties()
used in the form binding.- Throws:
IOException
- Since:
- 1.305
-
configure
public boolean configure(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject json) throws Descriptor.FormException Description copied from class:Descriptor
Invoked when the global configuration page is submitted. Can be overridden to store descriptor-specific information.- Overrides:
configure
in classDescriptor<ToolInstallation>
json
- The JSON object that captures the configuration data for thisDescriptor
. See the developer documentation.- Returns:
- false to keep the client in the same config page.
- Throws:
Descriptor.FormException
-
configure
@Deprecated public boolean configure(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject json) throws Descriptor.FormException Deprecated.- Overrides:
configure
in classDescriptor<ToolInstallation>
- Throws:
Descriptor.FormException
-
doCheckHome
Checks if the home directory is valid.- Since:
- 1.563
-
checkHomeDirectory
May be overridden to provide tool-specific validation of a tool home directory.- Parameters:
home
- a possible value forToolInstallation.getHome()
, known to already exist on the controller TODO(terminology) or is it built-in?- Returns:
- by default,
FormValidation.ok()
- Since:
- 1.563
-
doCheckName
Checks if the tool name is valid.- Since:
- 1.563
-
configure(StaplerRequest2, JSONObject)