public abstract class BaseParameterConstraint extends Object implements ParameterConstraint, org.springframework.beans.factory.BeanNameAware
Modifier and Type | Field and Description |
---|---|
protected RuntimeActionService |
actionService
Runtime action service
|
protected Map<String,String> |
allowableValues
Map of allowable values
|
protected boolean |
cache
Flag to determine whether the allowable values should be cached
|
protected String |
name
Constraint name
|
Constructor and Description |
---|
BaseParameterConstraint() |
Modifier and Type | Method and Description |
---|---|
Map<String,String> |
getAllowableValues()
The implementers are expected to return allowed values in the insertion order.
|
protected abstract Map<String,String> |
getAllowableValuesImpl()
Gets the list of allowable values, calculating them every time it is called.
|
protected String |
getI18NLabel(String key)
Get the I18N display label for a particular key
|
String |
getName()
Gets the unique name of the constraint
|
String |
getValueDisplayLabel(String value) |
void |
init()
Init method
|
boolean |
isValidValue(String value)
Indicates whether the provided value satisfies the constraint.
|
void |
setActionService(RuntimeActionService actionService)
Set the action service
|
void |
setBeanName(String name) |
void |
setCacheAllowableValues(boolean cache)
Determines whether the allowable values should be cached, default is true.
|
protected String name
protected RuntimeActionService actionService
protected boolean cache
public void init()
public void setActionService(RuntimeActionService actionService)
actionService
- action servicepublic void setCacheAllowableValues(boolean cache)
cache
- booleanpublic String getName()
ParameterConstraint
getName
in interface ParameterConstraint
ParameterConstraint.getName()
public void setBeanName(String name)
setBeanName
in interface org.springframework.beans.factory.BeanNameAware
BeanNameAware.setBeanName(java.lang.String)
public Map<String,String> getAllowableValues()
ParameterConstraint
getAllowableValues
in interface ParameterConstraint
ParameterConstraint.getAllowableValues()
protected abstract Map<String,String> getAllowableValuesImpl()
protected String getI18NLabel(String key)
key
- Stringpublic String getValueDisplayLabel(String value)
getValueDisplayLabel
in interface ParameterConstraint
value
- StringParameterConstraint.getValueDisplayLabel(String)
public boolean isValidValue(String value)
ParameterConstraint
isValidValue
in interface ParameterConstraint
ParameterConstraint.isValidValue(String)
Copyright © 2005–2017 Alfresco Software. All rights reserved.