Class AbstractConstraint
- java.lang.Object
-
- org.nuxeo.ecm.core.schema.types.constraints.AbstractConstraint
-
- All Implemented Interfaces:
Serializable
,Constraint
- Direct Known Subclasses:
DateIntervalConstraint
,EnumConstraint
,LengthConstraint
,NotNullConstraint
,NumericIntervalConstraint
,ObjectResolverConstraint
,PatternConstraint
,TypeConstraint
public abstract class AbstractConstraint extends Object implements Constraint
This constraint ensures some date representation is in an enumeration.
This constraint can validate any
Date
orCalendar
. This constraint also supportNumber
types whose long value is recognised as number of milliseconds since January 1, 1970, 00:00:00 GMT.- Since:
- 7.1
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.nuxeo.ecm.core.schema.types.constraints.Constraint
Constraint.Description
-
-
Field Summary
-
Fields inherited from interface org.nuxeo.ecm.core.schema.types.constraints.Constraint
MESSAGES_BUNDLE, MESSAGES_DEFAULT_LANG, MESSAGES_KEY
-
-
Constructor Summary
Constructors Constructor Description AbstractConstraint()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getErrorMessage(Object invalidValue, Locale locale)
Provides an error message to display when some invalid value does not match existing entity.String
getMessageKey()
Provides the message key.static String
getMessageString(String bundleName, String key, Object[] params, Locale locale)
Try to get the message from the given message bundle.String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.nuxeo.ecm.core.schema.types.constraints.Constraint
getDescription, validate
-
-
-
-
Method Detail
-
getMessageKey
public String getMessageKey()
Description copied from interface:Constraint
Provides the message key.- Specified by:
getMessageKey
in interfaceConstraint
- Returns:
- The message key
-
getErrorMessage
public String getErrorMessage(Object invalidValue, Locale locale)
Description copied from interface:Constraint
Provides an error message to display when some invalid value does not match existing entity.- Specified by:
getErrorMessage
in interfaceConstraint
- Parameters:
invalidValue
- The invalid value that don't match any entity.locale
- The language in which the message should be generated.- Returns:
- A message in the specified language or
-
-