org.hudsonci.maven.plugin.builder
Class MavenBuilderDescriptor

java.lang.Object
  extended by hudson.model.Descriptor<T>
      extended by hudson.tasks.BuildStepDescriptor<Builder>
          extended by org.hudsonci.maven.plugin.builder.MavenBuilderDescriptor
All Implemented Interfaces:
Saveable

@Named
@Singleton
@Typed(value=hudson.model.Descriptor.class)
public class MavenBuilderDescriptor
extends BuildStepDescriptor<Builder>

MavenBuilder descriptor. Contains configuration information about the builder. When adding new options update DEFAULTS and createConfiguration(JSONObject) with the default and UI translator.

Since:
2.1.0
Author:
Jason Dillon

Nested Class Summary
 
Nested classes/interfaces inherited from class hudson.model.Descriptor
Descriptor.FormException, Descriptor.PropertyType
 
Field Summary
static BuildConfigurationDTO DEFAULTS
           
static String DESCRIPTOR_FILE_NAME
           
 
Fields inherited from class hudson.model.Descriptor
clazz
 
Fields inherited from interface hudson.model.Saveable
NOOP
 
Constructor Summary
MavenBuilderDescriptor(SecurityService security, DocumentManager documents, MavenInstallation.DescriptorImpl installationDescriptor)
           
 
Method Summary
 boolean configure(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject data)
          Configure the defaults.
 RenderableEnum[] getChecksumModeValues()
           
 XmlFile getConfigFile()
           
 BuildConfigurationDTO getDefaults()
           
 String getDisplayName()
           
 DocumentManager getDocuments()
           
 RenderableEnum[] getFailModeValues()
           
 MavenInstallation[] getInstallations()
           
 RenderableEnum[] getMakeModeValues()
           
 Collection<DocumentDTO> getSettingsDocuments()
           
 RenderableEnum[] getSnapshotUpdateModeValues()
           
 Collection<DocumentDTO> getToolChainsDocuments()
           
 RenderableEnum[] getVerbosityValues()
           
 boolean isApplicable(Class<? extends AbstractProject> type)
           
 boolean isSelected(Object value, Object configValue, Object defaultValue)
          Determine if a value is selected.
 Builder newInstance(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject data)
          Create a new instance.
 void setDefaults(BuildConfigurationDTO defaults)
           
 String valueOf(List<String> value, List<String> defaultValue)
          Determine the value to be used for the given lists and render.
 Object valueOf(Object value, Object defaultValue)
          Determine the value to be used.
 String valueOf(PropertiesDTO value, PropertiesDTO defaultValue)
          Determine the value to be used for the given properties and render.
 
Methods inherited from class hudson.tasks.BuildStepDescriptor
filter
 
Methods inherited from class hudson.model.Descriptor
calcAutoCompleteSettings, calcFillSettings, configure, doHelp, find, find, getCheckUrl, getConfigPage, getDescriptorUrl, getGlobalConfigPage, getGlobalPropertyType, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getPropertyType, getPropertyType, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, save, toArray, toList, toMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULTS

public static final BuildConfigurationDTO DEFAULTS

DESCRIPTOR_FILE_NAME

public static final String DESCRIPTOR_FILE_NAME
See Also:
Constant Field Values
Constructor Detail

MavenBuilderDescriptor

@Inject
public MavenBuilderDescriptor(SecurityService security,
                                     DocumentManager documents,
                                     MavenInstallation.DescriptorImpl installationDescriptor)
Method Detail

getDisplayName

public String getDisplayName()
Specified by:
getDisplayName in class Descriptor<Builder>

isApplicable

public boolean isApplicable(Class<? extends AbstractProject> type)
Specified by:
isApplicable in class BuildStepDescriptor<Builder>

getConfigFile

public XmlFile getConfigFile()
Overrides:
getConfigFile in class Descriptor<Builder>

getDefaults

@JellyAccessible
public BuildConfigurationDTO getDefaults()

getDocuments

public DocumentManager getDocuments()

setDefaults

public void setDefaults(BuildConfigurationDTO defaults)

getVerbosityValues

@JellyAccessible
public RenderableEnum[] getVerbosityValues()

getChecksumModeValues

@JellyAccessible
public RenderableEnum[] getChecksumModeValues()

getFailModeValues

@JellyAccessible
public RenderableEnum[] getFailModeValues()

getMakeModeValues

@JellyAccessible
public RenderableEnum[] getMakeModeValues()

getSnapshotUpdateModeValues

@JellyAccessible
public RenderableEnum[] getSnapshotUpdateModeValues()

getSettingsDocuments

@JellyAccessible
public Collection<DocumentDTO> getSettingsDocuments()

getToolChainsDocuments

@JellyAccessible
public Collection<DocumentDTO> getToolChainsDocuments()

isSelected

@JellyAccessible
public boolean isSelected(Object value,
                                          Object configValue,
                                          Object defaultValue)
Determine if a value is selected. If the value equals the configured value or the configured value is null and value equals the default value, then it is selected.

Parameters:
value - The value, from an enum items or something; never null.
configValue - The instance configuration value; may be null.
defaultValue - The descriptor default value; may be null.
Returns:
True if the value is selected.

valueOf

@JellyAccessible
public Object valueOf(Object value,
                                      Object defaultValue)
Determine the value to be used. If the given value is non-null then it will be used, else the default value will be used. For use when jelly tag does not expose a default attribute, only a value attribute.


valueOf

@JellyAccessible
public String valueOf(PropertiesDTO value,
                                      PropertiesDTO defaultValue)
Determine the value to be used for the given properties and render.


valueOf

@JellyAccessible
public String valueOf(List<String> value,
                                      List<String> defaultValue)
Determine the value to be used for the given lists and render.


getInstallations

@JellyAccessible
public MavenInstallation[] getInstallations()

configure

public boolean configure(org.kohsuke.stapler.StaplerRequest req,
                         net.sf.json.JSONObject data)
                  throws Descriptor.FormException
Configure the defaults.

Overrides:
configure in class Descriptor<Builder>
Throws:
Descriptor.FormException

newInstance

public Builder newInstance(org.kohsuke.stapler.StaplerRequest req,
                           net.sf.json.JSONObject data)
                    throws Descriptor.FormException
Create a new instance.

Overrides:
newInstance in class Descriptor<Builder>
Throws:
Descriptor.FormException


Copyright © 2004-2011 Hudson. All Rights Reserved.