Class BaseParameterConstraint
java.lang.Object
org.alfresco.repo.action.constraint.BaseParameterConstraint
- All Implemented Interfaces:
ParameterConstraint,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware
- Direct Known Subclasses:
AspectParameterConstraint,EnumParameterConstraint,FolderContentsParameterConstraint,MimetypeParameterConstraint,PropertyParameterConstraint,TypeParameterConstraint
public abstract class BaseParameterConstraint
extends Object
implements ParameterConstraint, org.springframework.beans.factory.BeanNameAware
Base implementation of a parameter constraint
- Author:
- Roy Wetherall
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected RuntimeActionServiceRuntime action serviceMap of allowable valuesprotected booleanFlag to determine whether the allowable values should be cachedprotected StringConstraint name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe implementers are expected to return allowed values in the insertion order.Gets the list of allowable values, calculating them every time it is called.protected StringgetI18NLabel(String key) Get the I18N display label for a particular keygetName()Gets the unique name of the constraintgetValueDisplayLabel(String value) voidinit()Init methodbooleanisValidValue(String value) Indicates whether the provided value satisfies the constraint.voidsetActionService(RuntimeActionService actionService) Set the action servicevoidsetBeanName(String name) voidsetCacheAllowableValues(boolean cache) Determines whether the allowable values should be cached, default is true.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.alfresco.service.cmr.action.ParameterConstraint
getValues
-
Field Details
-
name
Constraint name -
actionService
Runtime action service -
cache
protected boolean cacheFlag to determine whether the allowable values should be cached -
allowableValues
Map of allowable values
-
-
Constructor Details
-
BaseParameterConstraint
public BaseParameterConstraint()
-
-
Method Details
-
init
public void init()Init method -
setActionService
Set the action service- Parameters:
actionService- action service
-
setCacheAllowableValues
public void setCacheAllowableValues(boolean cache) Determines whether the allowable values should be cached, default is true.- Parameters:
cache- boolean
-
getName
Description copied from interface:ParameterConstraintGets the unique name of the constraint- Specified by:
getNamein interfaceParameterConstraint- Returns:
- String constraint name
- See Also:
-
setBeanName
- Specified by:
setBeanNamein interfaceorg.springframework.beans.factory.BeanNameAware- See Also:
-
BeanNameAware.setBeanName(java.lang.String)
-
getAllowableValues
Description copied from interface:ParameterConstraintThe implementers are expected to return allowed values in the insertion order.- Specified by:
getAllowableValuesin interfaceParameterConstraint- See Also:
-
getAllowableValuesImpl
Gets the list of allowable values, calculating them every time it is called.- Returns:
- map of allowable values
-
getI18NLabel
Get the I18N display label for a particular key- Parameters:
key- String- Returns:
- String I18N value
-
getValueDisplayLabel
- Specified by:
getValueDisplayLabelin interfaceParameterConstraint- Parameters:
value- String- Returns:
- String
- See Also:
-
isValidValue
Description copied from interface:ParameterConstraintIndicates whether the provided value satisfies the constraint. True if it does, false otherwise.- Specified by:
isValidValuein interfaceParameterConstraint- Returns:
- boolean true if valid, false otherwise
- See Also:
-