hudson.plugins.analysis.core
Class PluginDescriptor

java.lang.Object
  extended by hudson.model.Descriptor<T>
      extended by hudson.tasks.BuildStepDescriptor<hudson.tasks.Publisher>
          extended by hudson.plugins.analysis.core.PluginDescriptor
All Implemented Interfaces:
hudson.model.Saveable

public abstract class PluginDescriptor
extends hudson.tasks.BuildStepDescriptor<hudson.tasks.Publisher>

Base class for a Jankins plug-in descriptor.

Author:
Ulli Hafner

Nested Class Summary
 
Nested classes/interfaces inherited from class hudson.model.Descriptor
hudson.model.Descriptor.FormException, hudson.model.Descriptor.PropertyType
 
Field Summary
protected static String RESULT_URL_SUFFIX
          Suffix of the URL of the plug-in result.
 
Fields inherited from class hudson.model.Descriptor
clazz
 
Fields inherited from interface hudson.model.Saveable
NOOP
 
Constructor Summary
PluginDescriptor(Class<? extends hudson.tasks.Publisher> clazz)
          Creates a new instance of PluginDescriptor.
 
Method Summary
protected static net.sf.json.JSONObject convertHierarchicalFormData(net.sf.json.JSONObject hierarchical)
          Converts the hierarchical JSON object that contains a sub-section for to a corresponding flat JSON object.
static String createResultUrlName(String pluginName)
          Returns the result URL for the specified plug-in.
 hudson.util.FormValidation doCheckDefaultEncoding(String defaultEncoding)
          Performs on-the-fly validation on the character encoding.
 hudson.util.FormValidation doCheckHeight(String height)
          Performs on-the-fly validation on the trend graph height.
 hudson.util.FormValidation doCheckPattern(hudson.model.AbstractProject<?,?> project, String pattern)
          Performs on-the-fly validation on the file name pattern.
 hudson.util.FormValidation doCheckThreshold(String threshold)
          Performs on-the-fly validation on the annotations threshold.
 String getHelpFile()
           
abstract  String getIconUrl()
          Returns the URL of the plug-in icon (24x24 image).
abstract  String getPluginName()
          Returns the name of the plug-in.
 String getPluginResultUrlName()
          Returns the name of the plug-in.
 String getPluginRoot()
          Returns the root folder of this plug-in.
 String getSummaryIconUrl()
          Returns the URL of the build summary icon (48x48 image).
 boolean isApplicable(Class<? extends hudson.model.AbstractProject> jobType)
           
static boolean isPluginInstalled(String shortName)
          Returns whether the specified plug-in is installed.
 hudson.tasks.Publisher newInstance(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject formData)
           
 
Methods inherited from class hudson.tasks.BuildStepDescriptor
filter
 
Methods inherited from class hudson.model.Descriptor
calcAutoCompleteSettings, calcFillSettings, configure, configure, doHelp, find, find, getCheckUrl, getConfigFile, getConfigPage, getDescriptorUrl, getDisplayName, getGlobalConfigPage, getGlobalPropertyType, 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

RESULT_URL_SUFFIX

protected static final String RESULT_URL_SUFFIX
Suffix of the URL of the plug-in result.

See Also:
Constant Field Values
Constructor Detail

PluginDescriptor

public PluginDescriptor(Class<? extends hudson.tasks.Publisher> clazz)
Creates a new instance of PluginDescriptor.

Parameters:
clazz - the type of the publisher
Method Detail

createResultUrlName

public static String createResultUrlName(String pluginName)
Returns the result URL for the specified plug-in.

Parameters:
pluginName - the name of the plug-in
Returns:
the result URL of the plug-in

isPluginInstalled

public static boolean isPluginInstalled(String shortName)
Returns whether the specified plug-in is installed.

Parameters:
shortName - the plug-in to check
Returns:
true if the specified plug-in is installed, false if not.

convertHierarchicalFormData

protected static net.sf.json.JSONObject convertHierarchicalFormData(net.sf.json.JSONObject hierarchical)
Converts the hierarchical JSON object that contains a sub-section for to a corresponding flat JSON object.

Parameters:
hierarchical - the JSON object containing a sub-section
Returns:
the flat structure

newInstance

public hudson.tasks.Publisher newInstance(org.kohsuke.stapler.StaplerRequest req,
                                          net.sf.json.JSONObject formData)
                                   throws hudson.model.Descriptor.FormException
Overrides:
newInstance in class hudson.model.Descriptor<hudson.tasks.Publisher>
Throws:
hudson.model.Descriptor.FormException

getHelpFile

public final String getHelpFile()
Overrides:
getHelpFile in class hudson.model.Descriptor<hudson.tasks.Publisher>

getPluginRoot

public String getPluginRoot()
Returns the root folder of this plug-in.

Returns:
the name of the root folder of this plug-in

getPluginResultUrlName

public final String getPluginResultUrlName()
Returns the name of the plug-in.

Returns:
the name of the plug-in

getPluginName

public abstract String getPluginName()
Returns the name of the plug-in.

Returns:
the name of the plug-in

getIconUrl

public abstract String getIconUrl()
Returns the URL of the plug-in icon (24x24 image).

Returns:
the URL of the plug-in icon

getSummaryIconUrl

public String getSummaryIconUrl()
Returns the URL of the build summary icon (48x48 image).

Returns:
the URL of the plug-in icon
Since:
1.41

doCheckDefaultEncoding

public hudson.util.FormValidation doCheckDefaultEncoding(@QueryParameter
                                                         String defaultEncoding)
Performs on-the-fly validation on the character encoding.

Parameters:
defaultEncoding - the character encoding
Returns:
the validation result

doCheckPattern

public hudson.util.FormValidation doCheckPattern(@AncestorInPath
                                                 hudson.model.AbstractProject<?,?> project,
                                                 @QueryParameter
                                                 String pattern)
                                          throws IOException
Performs on-the-fly validation on the file name pattern.

Parameters:
project - the project
pattern - the file pattern
Returns:
the validation result
Throws:
IOException - if the encoding is not valid

doCheckThreshold

public hudson.util.FormValidation doCheckThreshold(@QueryParameter
                                                   String threshold)
Performs on-the-fly validation on the annotations threshold.

Parameters:
threshold - the character encoding
Returns:
the validation result

doCheckHeight

public hudson.util.FormValidation doCheckHeight(@QueryParameter
                                                String height)
Performs on-the-fly validation on the trend graph height.

Parameters:
height - the height
Returns:
the form validation

isApplicable

public boolean isApplicable(Class<? extends hudson.model.AbstractProject> jobType)
Specified by:
isApplicable in class hudson.tasks.BuildStepDescriptor<hudson.tasks.Publisher>


Copyright © 2004-2012 Hudson. All Rights Reserved.