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
FieldsModifier and TypeFieldDescriptionprotected HierarchicalReferenceTablesHelperThe helper component for hierarchical reference tablesprotected AmetysObjectResolverAmetys resolverFields inherited from class org.ametys.runtime.parameter.DefaultValidator
_invalidText, _isMandatory, _pluginName, _regexp, _smanager -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean_hasOnlyCandidates(ContentValue[] contents) Indicates if the array of contents contains only candidatesvoidservice(ServiceManager manager) protected ValidationResultvalidateArrayValues(Object[] values) Validates a array of values.protected ValidationResultvalidateSingleValue(Object value) Validates a single value.Methods inherited from class org.ametys.runtime.parameter.DefaultValidator
configure, equals, getConfiguration, hashCode, setPluginInfo, validateMethods 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:
servicein interfaceServiceable- Overrides:
servicein classDefaultValidator- Throws:
ServiceException
-
validateSingleValue
Description copied from class:DefaultValidatorValidates a single value.- Overrides:
validateSingleValuein classDefaultValidator- Parameters:
value- the value to validate (can benull).- Returns:
- the validation result
-
validateArrayValues
Description copied from class:DefaultValidatorValidates a array of values.- Overrides:
validateArrayValuesin classDefaultValidator- Parameters:
values- the values to validate- Returns:
- the validation result
-
_hasOnlyCandidates
Indicates if the array of contents contains only candidates- Parameters:
contents- the list of content- Returns:
- true if it contains only candidates
-