Class ReferenceValidator
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.runtime.parameter.DefaultValidator
-
- org.ametys.cms.contenttype.validation.ReferenceValidator
-
- All Implemented Interfaces:
Validator,PluginAware,Configurable,LogEnabled,Serviceable
public class ReferenceValidator extends DefaultValidator
This is an implementation ofDefaultValidatorforReference.
-
-
Field Summary
-
Fields inherited from class org.ametys.runtime.parameter.DefaultValidator
_invalidText, _isMandatory, _pluginName, _regexp, _smanager
-
-
Constructor Summary
Constructors Constructor Description ReferenceValidator()Default constructor for avalonReferenceValidator(String regexp, boolean mandatory)Manual constructorReferenceValidator(String regexp, I18nizableText invalidText, boolean mandatory)Manual constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidvalidate(Object value, Errors errors)Validates a value.-
Methods inherited from class org.ametys.runtime.parameter.DefaultValidator
configure, equals, getConfiguration, hashCode, service, setPluginInfo, validateArrayValues, validateSingleValue
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Constructor Detail
-
ReferenceValidator
public ReferenceValidator()
Default constructor for avalon
-
ReferenceValidator
public ReferenceValidator(String regexp, boolean mandatory)
Manual constructor- Parameters:
regexp- The regexp to check or nullmandatory- Is the value mandatory
-
ReferenceValidator
public ReferenceValidator(String regexp, I18nizableText invalidText, boolean mandatory)
Manual constructor- Parameters:
regexp- The regexp to check or nullinvalidText- The error text to displaymandatory- Is the value mandatory
-
-
Method Detail
-
validate
public void validate(Object value, Errors errors)
Description copied from interface:ValidatorValidates a value.- Specified by:
validatein interfaceValidator- Overrides:
validatein classDefaultValidator- Parameters:
value- the value to validate (can benull).errors- the structure to populate if the validation failed.
-
-