hudson.plugins.findbugs.util
Class SingleFieldValidator
java.lang.Object
hudson.util.FormFieldValidator
hudson.plugins.findbugs.util.SingleFieldValidator
- Direct Known Subclasses:
- EncodingValidator, ThresholdValidator, TrendReportHeightValidator
public abstract class SingleFieldValidator
- extends hudson.util.FormFieldValidator
Form field validator base class with template method to validate a single field value.
You need the following steps to validate a single form field:
- Create a subclass of
SingleFieldValidator.
- Create a subclass of
AbstractValidatorTest with corresponding
unit tests.
- Add a new entry in your jelly file with the attribute
field named
like your publishers or reporters property, e.g.
<f:editableComboBox id="defaultEncoding" field="defaultEncoding" items="${allEncodings}"/>
<f:textbox field="threshold"/>
- Create a method in your plug-in descriptor like
PluginDescriptor.doCheckDefaultEncoding(org.kohsuke.stapler.StaplerRequest, org.kohsuke.stapler.StaplerResponse) for the property defaultEncoding.
- Author:
- Ulli Hafner
| Nested classes/interfaces inherited from class hudson.util.FormFieldValidator |
hudson.util.FormFieldValidator.Base64, hudson.util.FormFieldValidator.Executable, hudson.util.FormFieldValidator.HudsonURL, hudson.util.FormFieldValidator.NonNegativeInteger, hudson.util.FormFieldValidator.URLCheck, hudson.util.FormFieldValidator.WorkspaceDirectory, hudson.util.FormFieldValidator.WorkspaceFileMask, hudson.util.FormFieldValidator.WorkspaceFilePath |
| Fields inherited from class hudson.util.FormFieldValidator |
CHECK, permission, request, response, subject |
|
Constructor Summary |
SingleFieldValidator(org.kohsuke.stapler.StaplerRequest request,
org.kohsuke.stapler.StaplerResponse response)
Creates a new instance of FormValidator. |
|
Method Summary |
void |
check()
|
abstract void |
check(java.lang.String value)
Checks the input value. |
| Methods inherited from class hudson.util.FormFieldValidator |
error, error, errorWithMarkup, getFileParameter, ok, ok, ok, okWithMarkup, process, respond, warning, warning, warningWithMarkup |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SingleFieldValidator
public SingleFieldValidator(org.kohsuke.stapler.StaplerRequest request,
org.kohsuke.stapler.StaplerResponse response)
- Creates a new instance of
FormValidator.
- Parameters:
request - Stapler requestresponse - Stapler response
check
public final void check()
throws java.io.IOException,
javax.servlet.ServletException
-
- Specified by:
check in class hudson.util.FormFieldValidator
- Throws:
java.io.IOException
javax.servlet.ServletException
check
public abstract void check(java.lang.String value)
throws java.io.IOException,
javax.servlet.ServletException
- Checks the input value.
- Parameters:
value - the value to check
- Throws:
java.io.IOException - Signals that an I/O exception has occurred.
javax.servlet.ServletException - the servlet exception
Copyright © 2009. All Rights Reserved.