Package hudson.util
Class FormFieldValidator
java.lang.Object
hudson.util.FormFieldValidator
- Direct Known Subclasses:
- FormFieldValidator.Base64,- FormFieldValidator.Executable,- FormFieldValidator.URLCheck,- FormFieldValidator.WorkspaceFileMask,- FormFieldValidator.WorkspaceFilePath
Deprecated.
Base class that provides the framework for doing on-the-fly form field validation.
 
 The check() method is to be implemented by derived classes to perform
 the validation. See hudson-behavior.js 'validated' CSS class and 'checkUrl' attribute.
- Author:
- Kohsuke Kawaguchi
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classDeprecated.as of 1.305 UseFormValidation.validateBase64(String, boolean, boolean, String)instead.static classDeprecated.as of 1.294.static classDeprecated.Checks if the given value is an URL to some Hudson's top page.static classDeprecated.as of 1.294 UseFormValidation.URLCheckstatic classDeprecated.as of 1.294.static classDeprecated.as of 1.294.static classDeprecated.as of 1.294.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final PermissionDeprecated.protected final PermissionDeprecated.Permission to check, or null if this check doesn't require any permission.protected final org.kohsuke.stapler.StaplerRequestDeprecated.protected final org.kohsuke.stapler.StaplerResponseDeprecated.protected final AccessControlledDeprecated.The object to which the permission is checked against.
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedFormFieldValidator(AccessControlled subject, Permission permission) Deprecated.protectedFormFieldValidator(Permission permission) Deprecated.protectedFormFieldValidator(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response, boolean adminOnly) Deprecated.protectedFormFieldValidator(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response, AccessControlled subject, Permission permission) Deprecated.UseFormFieldValidator(AccessControlled,Permission)and removeStaplerRequestandStaplerResponsefrom your "doCheck..." method parameterprotectedFormFieldValidator(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response, Permission permission) Deprecated.UseFormFieldValidator(Permission)and removeStaplerRequestandStaplerResponsefrom your "doCheck..." method parameter
- 
Method SummaryModifier and TypeMethodDescriptionprotected abstract voidcheck()Deprecated.voidDeprecated.Sends out a string error message that indicates an error.voidDeprecated.Sends out a string error message that indicates an error, by formatting it withString.format(String, Object[])voiderrorWithMarkup(String message) Deprecated.Sends out an HTML fragment that indicates an error.protected final FilegetFileParameter(String paramName) Deprecated.Gets the parameter as a file.voidok()Deprecated.Sends out an HTML fragment that indicates a success.voidDeprecated.voidDeprecated.voidokWithMarkup(String message) Deprecated.final voidprocess()Deprecated.Runs the validation code.voidDeprecated.Sends out an arbitrary HTML fragment.voidDeprecated.voidDeprecated.voidwarningWithMarkup(String message) Deprecated.
- 
Field Details- 
CHECKDeprecated.
- 
requestprotected final org.kohsuke.stapler.StaplerRequest requestDeprecated.
- 
responseprotected final org.kohsuke.stapler.StaplerResponse responseDeprecated.
- 
permissionDeprecated.Permission to check, or null if this check doesn't require any permission.
- 
subjectDeprecated.The object to which the permission is checked against. Ifpermissionis non-null, must be non-null.
 
- 
- 
Constructor Details- 
FormFieldValidatorprotected FormFieldValidator(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response, boolean adminOnly) Deprecated.- Parameters:
- adminOnly- Pass true to only let admin users to run the check. This is necessary for security reason, so that unauthenticated user cannot obtain sensitive information or run a process that may have side-effect.
 
- 
FormFieldValidator@Deprecated protected FormFieldValidator(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response, Permission permission) Deprecated.UseFormFieldValidator(Permission)and removeStaplerRequestandStaplerResponsefrom your "doCheck..." method parameter
- 
FormFieldValidatorDeprecated.- Parameters:
- permission- Permission needed to perform this validation, or null if no permission is necessary.
 
- 
FormFieldValidator@Deprecated protected FormFieldValidator(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response, AccessControlled subject, Permission permission) Deprecated.UseFormFieldValidator(AccessControlled,Permission)and removeStaplerRequestandStaplerResponsefrom your "doCheck..." method parameter
- 
FormFieldValidatorDeprecated.
 
- 
- 
Method Details- 
processDeprecated.Runs the validation code.- Throws:
- IOException
- javax.servlet.ServletException
 
- 
checkDeprecated.- Throws:
- IOException
- javax.servlet.ServletException
 
- 
getFileParameterDeprecated.Gets the parameter as a file.
- 
okDeprecated.Sends out an HTML fragment that indicates a success.- Throws:
- IOException
- javax.servlet.ServletException
 
- 
respondDeprecated.Sends out an arbitrary HTML fragment.- Throws:
- IOException
- javax.servlet.ServletException
 
- 
errorDeprecated.Sends out a string error message that indicates an error.- Parameters:
- message- Human readable message to be sent.- error(null)can be used as- ok().
- Throws:
- IOException
- javax.servlet.ServletException
 
- 
warningDeprecated.- Throws:
- IOException
- javax.servlet.ServletException
 
- 
okDeprecated.- Throws:
- IOException
- javax.servlet.ServletException
 
- 
errorDeprecated.Sends out a string error message that indicates an error, by formatting it withString.format(String, Object[])- Throws:
- IOException
- javax.servlet.ServletException
 
- 
warningpublic void warning(String format, Object... args) throws IOException, javax.servlet.ServletException Deprecated.- Throws:
- IOException
- javax.servlet.ServletException
 
- 
okDeprecated.- Throws:
- IOException
- javax.servlet.ServletException
 
- 
errorWithMarkupDeprecated.Sends out an HTML fragment that indicates an error.This method must be used with care to avoid cross-site scripting attack. - Parameters:
- message- Human readable message to be sent.- error(null)can be used as- ok().
- Throws:
- IOException
- javax.servlet.ServletException
 
- 
warningWithMarkupDeprecated.- Throws:
- IOException
- javax.servlet.ServletException
 
- 
okWithMarkupDeprecated.- Throws:
- IOException
- javax.servlet.ServletException
 
 
- 
FormValidationas a return value in your check method.