Class CandidatesValidator
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.runtime.parameter.DefaultValidator
org.ametys.cms.content.referencetable.CandidatesValidator
- All Implemented Interfaces:
Validator
,PluginAware
,Configurable
,LogEnabled
,Serviceable
This validator does not allow a set of values only containing candidates. At
least one content is expected
-
Field Summary
Modifier and TypeFieldDescriptionprotected HierarchicalReferenceTablesHelper
The helper component for hierarchical reference tablesprotected AmetysObjectResolver
Ametys resolverFields inherited from class org.ametys.runtime.parameter.DefaultValidator
_invalidText, _isMandatory, _pluginName, _regexp, _smanager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
_hasOnlyCandidates
(ContentValue[] contents) Indicates if the array of contents contains only candidatesvoid
service
(ServiceManager manager) protected 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
configure, equals, getConfiguration, hashCode, setPluginInfo, validate
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
_resolver
Ametys resolver -
_hierarchicalReferenceTablesHelper
The helper component for hierarchical reference tables
-
-
Constructor Details
-
CandidatesValidator
public CandidatesValidator()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classDefaultValidator
- Throws:
ServiceException
-
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.
-
_hasOnlyCandidates
Indicates if the array of contents contains only candidates- Parameters:
contents
- the list of content- Returns:
- true if it contains only candidates
-