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
public class CandidatesValidator extends DefaultValidator
This validator does not allow a set of values only containing candidates. At least one content is expected
-
-
Field Summary
Fields Modifier and Type Field Description protected HierarchicalReferenceTablesHelper_hierarchicalReferenceTablesHelperThe helper component for hierarchical reference tablesprotected AmetysObjectResolver_resolverAmetys resolver-
Fields inherited from class org.ametys.runtime.parameter.DefaultValidator
_invalidText, _isMandatory, _pluginName, _regexp, _smanager
-
-
Constructor Summary
Constructors Constructor Description CandidatesValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean_hasOnlyCandidates(Object[] values)protected boolean_hasOnlyContentCandidates(Content[] contents)Indicates if the array of contents contains only candidatesprotected void_validateSingleContent(Content content, Errors errors)Validate a single content (true if not a candidate)voidservice(ServiceManager manager)protected voidvalidateArrayValues(Object[] values, Errors errors)Validates a array of values.protected voidvalidateSingleValue(Object value, Errors errors)Validates a single value.-
Methods inherited from class org.ametys.runtime.parameter.DefaultValidator
configure, getConfiguration, setPluginInfo, validate
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_resolver
protected AmetysObjectResolver _resolver
Ametys resolver
-
_hierarchicalReferenceTablesHelper
protected HierarchicalReferenceTablesHelper _hierarchicalReferenceTablesHelper
The helper component for hierarchical reference tables
-
-
Constructor Detail
-
CandidatesValidator
public CandidatesValidator()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classDefaultValidator- Throws:
ServiceException
-
validateSingleValue
protected void validateSingleValue(Object value, Errors errors)
Description copied from class:DefaultValidatorValidates a single value.- Overrides:
validateSingleValuein classDefaultValidator- Parameters:
value- the value to validate (can benull).errors- the structure to populate if the validation failed.
-
_validateSingleContent
protected void _validateSingleContent(Content content, Errors errors)
Validate a single content (true if not a candidate)- Parameters:
content- the contenterrors- the list of errors (seeErrors)
-
validateArrayValues
protected void validateArrayValues(Object[] values, Errors errors)
Description copied from class:DefaultValidatorValidates a array of values.- Overrides:
validateArrayValuesin classDefaultValidator- Parameters:
values- the values to validateerrors- the structure to populate if the validation failed.
-
_hasOnlyCandidates
private boolean _hasOnlyCandidates(Object[] values)
-
_hasOnlyContentCandidates
protected boolean _hasOnlyContentCandidates(Content[] contents)
Indicates if the array of contents contains only candidates- Parameters:
contents- the list of content- Returns:
- true if it contains only candidates
-
-