Package hudson.util
Class FormFieldValidator
java.lang.Object
hudson.util.FormFieldValidator
- Direct Known Subclasses:
FormFieldValidator.Base64
,FormFieldValidator.Executable
,FormFieldValidator.NonNegativeInteger
,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 Summary
Modifier and TypeClassDescriptionstatic class
Deprecated.as of 1.305 UseFormValidation.validateBase64(String, boolean, boolean, String)
instead.static class
Deprecated.as of 1.294.static class
Deprecated.Checks if the given value is an URL to some Hudson's top page.static class
Deprecated.as of 1.294 UseFormValidation.validateNonNegativeInteger(String)
static class
Deprecated.as of 1.294 UseFormValidation.URLCheck
static class
Deprecated.as of 1.294.static class
Deprecated.as of 1.294.static class
Deprecated.as of 1.294. -
Field Summary
Modifier and TypeFieldDescriptionstatic final Permission
Deprecated.protected final Permission
Deprecated.Permission to check, or null if this check doesn't require any permission.protected final org.kohsuke.stapler.StaplerRequest
Deprecated.protected final org.kohsuke.stapler.StaplerResponse
Deprecated.protected final AccessControlled
Deprecated.The object to which the permission is checked against. -
Constructor Summary
ModifierConstructorDescriptionprotected
FormFieldValidator
(AccessControlled subject, Permission permission) Deprecated.protected
FormFieldValidator
(Permission permission) Deprecated.protected
FormFieldValidator
(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response, boolean adminOnly) Deprecated.protected
FormFieldValidator
(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response, AccessControlled subject, Permission permission) Deprecated.UseFormFieldValidator(AccessControlled,Permission)
and removeStaplerRequest
andStaplerResponse
from your "doCheck..." method parameterprotected
FormFieldValidator
(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response, Permission permission) Deprecated.UseFormFieldValidator(Permission)
and removeStaplerRequest
andStaplerResponse
from your "doCheck..." method parameter -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
check()
Deprecated.void
Deprecated.Sends out a string error message that indicates an error.void
Deprecated.Sends out a string error message that indicates an error, by formatting it withString.format(String, Object[])
void
errorWithMarkup
(String message) Deprecated.Sends out an HTML fragment that indicates an error.protected final File
getFileParameter
(String paramName) Deprecated.Gets the parameter as a file.void
ok()
Deprecated.Sends out an HTML fragment that indicates a success.void
Deprecated.void
Deprecated.void
okWithMarkup
(String message) Deprecated.final void
process()
Deprecated.Runs the validation code.void
Deprecated.Sends out an arbitrary HTML fragment.void
Deprecated.void
Deprecated.void
warningWithMarkup
(String message) Deprecated.
-
Field Details
-
CHECK
Deprecated. -
request
protected final org.kohsuke.stapler.StaplerRequest requestDeprecated. -
response
protected final org.kohsuke.stapler.StaplerResponse responseDeprecated. -
permission
Deprecated.Permission to check, or null if this check doesn't require any permission. -
subject
Deprecated.The object to which the permission is checked against. Ifpermission
is non-null, must be non-null.
-
-
Constructor Details
-
FormFieldValidator
protected 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 removeStaplerRequest
andStaplerResponse
from your "doCheck..." method parameter -
FormFieldValidator
Deprecated.- 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 removeStaplerRequest
andStaplerResponse
from your "doCheck..." method parameter -
FormFieldValidator
Deprecated.
-
-
Method Details
-
process
Deprecated.Runs the validation code.- Throws:
IOException
javax.servlet.ServletException
-
check
Deprecated.- Throws:
IOException
javax.servlet.ServletException
-
getFileParameter
Deprecated.Gets the parameter as a file. -
ok
Deprecated.Sends out an HTML fragment that indicates a success.- Throws:
IOException
javax.servlet.ServletException
-
respond
Deprecated.Sends out an arbitrary HTML fragment.- Throws:
IOException
javax.servlet.ServletException
-
error
Deprecated.Sends out a string error message that indicates an error.- Parameters:
message
- Human readable message to be sent.error(null)
can be used asok()
.- Throws:
IOException
javax.servlet.ServletException
-
warning
Deprecated.- Throws:
IOException
javax.servlet.ServletException
-
ok
Deprecated.- Throws:
IOException
javax.servlet.ServletException
-
error
Deprecated.Sends out a string error message that indicates an error, by formatting it withString.format(String, Object[])
- Throws:
IOException
javax.servlet.ServletException
-
warning
public void warning(String format, Object... args) throws IOException, javax.servlet.ServletException Deprecated.- Throws:
IOException
javax.servlet.ServletException
-
ok
Deprecated.- Throws:
IOException
javax.servlet.ServletException
-
errorWithMarkup
Deprecated.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 asok()
.- Throws:
IOException
javax.servlet.ServletException
-
warningWithMarkup
Deprecated.- Throws:
IOException
javax.servlet.ServletException
-
okWithMarkup
Deprecated.- Throws:
IOException
javax.servlet.ServletException
-
FormValidation
as a return value in your check method.