org.apache.turbine.util.validation
Class InputValidator
java.lang.Object
|
+--org.apache.turbine.util.validation.InputValidator
- Direct Known Subclasses:
- AlwaysTrueValidator, EmailValidator, NotEmpty
- public abstract class InputValidator
- extends java.lang.Object
- Author:
- Mike Haberman
Constructor Summary |
InputValidator()
default Constructor, |
InputValidator(boolean allowNullInput,
int maxSize,
java.lang.String argv)
Constructor, |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
AllowNullInput
public static final boolean AllowNullInput
NoMaxSize
public static final int NoMaxSize
EmptyArgv
public static final java.lang.String EmptyArgv
NullInputError
private static java.lang.String NullInputError
MaxSizeExceededError
private static java.lang.String MaxSizeExceededError
allowNullInput
private boolean allowNullInput
maxSize
private int maxSize
argv
private java.lang.String argv
InputValidator
public InputValidator()
- default Constructor,
InputValidator
public InputValidator(boolean allowNullInput,
int maxSize,
java.lang.String argv)
- Constructor,
- Parameters:
boolean
- allowNullInputint
- maxSizeString
- argv
setAllowNullInput
public void setAllowNullInput(boolean allowNullInput)
- Parameters:
boolean
- allowNullInput, set allowNullInput
setMaxSize
public void setMaxSize(int maxSize)
- Parameters:
int
- maxSize, set maxSize
setArgv
public void setArgv(java.lang.String argv)
- Parameters:
String
- argv, set argv
isValid
public boolean isValid(java.lang.String input)
- Parameters:
String
- input, input to be checked- Returns:
- boolean, whether or not the input is valid
getErrorMessage
public java.lang.String getErrorMessage(java.lang.String input)
- Parameters:
String
- input, input to be checked- Returns:
- String, error message or null
checkInput
public void checkInput(java.lang.String value)
throws java.lang.Exception
- Parameters:
String
- value- Throws:
Exception,
- a generic exception.
getExpectedFormat
public abstract java.lang.String getExpectedFormat()
- Returns:
- String, the expected format of the input
check
protected abstract void check(java.lang.String input)
throws java.lang.Exception
- Parameters:
String
- input, input to be checked
all subclasses must define this method
Copyright © 1999-2001 Apache Software Foundation. All Rights Reserved.