Class TextValidator
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.runtime.parameter.DefaultValidator
org.ametys.plugins.core.parameter.TextValidator
- All Implemented Interfaces:
Validator
,PluginAware
,Configurable
,LogEnabled
,Serviceable
- Direct Known Subclasses:
RichTextValidator
Implements the same configuration as the DefaultValidator and also handle a <maxlength> parameter that allows a max count of chars
-
Field Summary
Fields inherited from class org.ametys.runtime.parameter.DefaultValidator
_invalidText, _isMandatory, _pluginName, _regexp, _smanager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
configure
(Configuration configuration) Retrieves the configuration of the validator.protected String
Get the textprotected void
validateArrayValues
(Object[] values, Errors errors) Validates a array of values.protected void
validateSingleValue
(Object value, Errors errors) Validates a single value.Methods inherited from class org.ametys.runtime.parameter.DefaultValidator
equals, hashCode, service, setPluginInfo, validate
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
_maxLength
Does the value has a max length
-
-
Constructor Details
-
TextValidator
public TextValidator()
-
-
Method Details
-
configure
- Specified by:
configure
in interfaceConfigurable
- Overrides:
configure
in classDefaultValidator
- Throws:
ConfigurationException
-
getConfiguration
Description copied from interface:Validator
Retrieves the configuration of the validator.- Specified by:
getConfiguration
in interfaceValidator
- Overrides:
getConfiguration
in classDefaultValidator
- Returns:
- a map containing the configuration information.
-
validateSingleValue
Description copied from class:DefaultValidator
Validates a single value.- Overrides:
validateSingleValue
in classDefaultValidator
- Parameters:
value
- the value to validate (can benull
).errors
- the structure to populate if the validation failed.
-
validateArrayValues
Description copied from class:DefaultValidator
Validates a array of values.- Overrides:
validateArrayValues
in classDefaultValidator
- Parameters:
values
- the values to validateerrors
- the structure to populate if the validation failed.
-
getText
Get the text- Parameters:
value
- The value to convert to text- Returns:
- the value converted
-