Class RequiredFileFieldValidator
- java.lang.Object
-
- com.opensymphony.xwork2.validator.validators.ValidatorSupport
-
- com.opensymphony.xwork2.validator.validators.FieldValidatorSupport
-
- org.nuiton.validator.xwork2.field.NuitonFieldValidatorSupport
-
- org.nuiton.validator.xwork2.field.RequiredFileFieldValidator
-
- All Implemented Interfaces:
com.opensymphony.xwork2.validator.FieldValidator,com.opensymphony.xwork2.validator.ShortCircuitableValidator,com.opensymphony.xwork2.validator.Validator
public class RequiredFileFieldValidator extends NuitonFieldValidatorSupport
RequiredFileFieldValidator checks that a File field is not null nor have an empty filename.- fieldName - The field name this validator is validating. Required if using Plain-Validator Syntax otherwise not required
<validators> <!-- Plain-Validator Syntax --> <validator type="requiredFile"> <param name="fieldName">tmp</param> <message>tmp is required</message> </validator> <!-- Field-Validator Syntax --> <field name="tmp"> <field-validator type="requiredFile"> <message>tmp is required</message> </field-validator> </field> </validators>- Author:
- Tony Chemit - chemit@codelutin.com
-
-
Field Summary
-
Fields inherited from class org.nuiton.validator.xwork2.field.NuitonFieldValidatorSupport
skip
-
-
Constructor Summary
Constructors Constructor Description RequiredFileFieldValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetValidatorType()voidvalidateWhenNotSkip(Object object)Method to be invoked when skip parameter was not evaludated totrue.-
Methods inherited from class org.nuiton.validator.xwork2.field.NuitonFieldValidatorSupport
evaluateSkipParameter, getFieldValue, setSkip, validate
-
Methods inherited from class com.opensymphony.xwork2.validator.validators.FieldValidatorSupport
getCurrentValue, getFieldName, setFieldName, setValidatorType
-
Methods inherited from class com.opensymphony.xwork2.validator.validators.ValidatorSupport
addActionError, addFieldError, getDefaultMessage, getMessage, getMessageKey, getMessageParameters, getValidatorContext, isShortCircuit, parse, setDefaultMessage, setMessageKey, setMessageParameters, setShortCircuit, setTextProviderFactory, setValidatorContext, setValueStack
-
-
-
-
Method Detail
-
validateWhenNotSkip
public void validateWhenNotSkip(Object object) throws com.opensymphony.xwork2.validator.ValidationException
Description copied from class:NuitonFieldValidatorSupportMethod to be invoked when skip parameter was not evaludated totrue.- Specified by:
validateWhenNotSkipin classNuitonFieldValidatorSupport- Parameters:
object- the object to be validated.- Throws:
com.opensymphony.xwork2.validator.ValidationException- is thrown if there is validation error(s).
-
getValidatorType
public String getValidatorType()
- Specified by:
getValidatorTypein interfacecom.opensymphony.xwork2.validator.Validator- Overrides:
getValidatorTypein classcom.opensymphony.xwork2.validator.validators.FieldValidatorSupport
-
-