|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.properties.spi.core.constraint.AbstractPropertyConstraint<T> de.smartics.properties.spi.core.constraints.PropertyRangeConstraint<T>
T
- the type of the property value.
public final class PropertyRangeConstraint<T>
Constraint that requires values to be part of an enumeration.
Constructor Summary | |
---|---|
PropertyRangeConstraint(PropertyValueRange<T> valueRange) Default constructor. |
Method Summary | |
---|---|
String |
getDescription(Locale locale) Returns a localized description of the defined constraints. |
PropertyValueRange<T> |
getValueRange() Returns the list of valid properties. |
boolean |
isValid(T value, Class<?> group) Checks if the given value is valid only if the constraint is in the given group. |
Methods inherited from class de.smartics.properties.spi.core.constraint.AbstractPropertyConstraint |
---|
getDescription, getViolationMessage, isMandatoryConstraint, isValid, toString, validate, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PropertyRangeConstraint(PropertyValueRange<T> valueRange)
valueRange
- the list of valid properties.
Method Detail |
---|
public PropertyValueRange<T> getValueRange()
A value of null
tells that there is no range defined.
public String getDescription(Locale locale)
PropertyConstraint
locale
- the locale to use to fetch a localized description.
public boolean isValid(T value, Class<?> group)
PropertyConstraint
value
- the value to be checked.
group
- the validation only takes place if this constraint is in this group or the argument is
null
.
true
if the
value
is valid,
false
otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |