Package hudson.tools
Class ToolDescriptor<T extends ToolInstallation>
- java.lang.Object
-
- hudson.model.Descriptor<ToolInstallation>
-
- hudson.tools.ToolDescriptor<T>
-
- 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
Constructors Modifier Constructor Description protected
ToolDescriptor()
protected
ToolDescriptor(Class<T> clazz)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected FormValidation
checkHomeDirectory(File home)
May be overridden to provide tool-specific validation of a tool home directory.boolean
configure(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject json)
Invoked when the global configuration page is submitted.FormValidation
doCheckHome(File value)
Checks if the home directory is valid.FormValidation
doCheckName(String value)
Checks if the tool name is valid.GlobalConfigurationCategory
getCategory()
Define the global configuration category the global config of this Descriptor is in.List<? extends ToolInstaller>
getDefaultInstallers()
Optional list of installers to be configured by default for new tools of this type.DescribableList<ToolProperty<?>,ToolPropertyDescriptor>
getDefaultProperties()
Default value forToolInstallation.getProperties()
used in the form binding.T[]
getInstallations()
Configured instances ofToolInstallation
s.List<ToolPropertyDescriptor>
getPropertyDescriptors()
Lists upToolPropertyDescriptor
s that are applicable to thisToolInstallation
.void
setInstallations(T... installations)
OverwritesToolInstallation
s.-
Methods inherited from class hudson.model.Descriptor
addHelpFileRedirect, bindJSON, calcAutoCompleteSettings, calcFillSettings, configure, 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, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
-
-
-
-
Method Detail
-
getInstallations
public T[] getInstallations()
Configured instances ofToolInstallation
s.- Returns:
- read-only list of installations; can be empty but never null.
-
setInstallations
public void setInstallations(T... installations)
OverwritesToolInstallation
s.- Parameters:
installations
- list of installations; can be empty but never null.
-
getPropertyDescriptors
public List<ToolPropertyDescriptor> getPropertyDescriptors()
Lists upToolPropertyDescriptor
s that are applicable to thisToolInstallation
.
-
getCategory
@NonNull public GlobalConfigurationCategory 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
public List<? extends ToolInstaller> 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 IOException
Default value forToolInstallation.getProperties()
used in the form binding.- Throws:
IOException
- Since:
- 1.305
-
configure
public boolean configure(org.kohsuke.stapler.StaplerRequest 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
-
doCheckHome
public FormValidation doCheckHome(@QueryParameter File value)
Checks if the home directory is valid.- Since:
- 1.563
-
checkHomeDirectory
protected FormValidation checkHomeDirectory(File home)
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
public FormValidation doCheckName(@QueryParameter String value)
Checks if the tool name is valid.- Since:
- 1.563
-
-