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
-
Constructor Summary
Constructors Constructor Description RequiredFileFieldValidator() -
Method Summary
Modifier and Type Method Description java.lang.StringgetValidatorType()voidvalidateWhenNotSkip(java.lang.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, validateMethods inherited from class com.opensymphony.xwork2.validator.validators.FieldValidatorSupport
getCurrentValue, getFieldName, setFieldName, setValidatorTypeMethods 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
-
Constructor Details
-
RequiredFileFieldValidator
public RequiredFileFieldValidator()
-
-
Method Details
-
validateWhenNotSkip
public void validateWhenNotSkip(java.lang.Object object) throws com.opensymphony.xwork2.validator.ValidationExceptionDescription 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 java.lang.String getValidatorType()- Specified by:
getValidatorTypein interfacecom.opensymphony.xwork2.validator.Validator- Overrides:
getValidatorTypein classcom.opensymphony.xwork2.validator.validators.FieldValidatorSupport
-