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
This constraint ensures some date representation is in an enumeration.
This constraint can validate any Date
or Calendar
. This constraint also support Number
types
whose long value is recognised as number of milliseconds since January 1, 1970, 00:00:00 GMT.
- Since:
- 7.1
- See Also:
-
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
-
Method Summary
Modifier and TypeMethodDescriptiongetErrorMessage
(Object invalidValue, Locale locale) Provides an error message to display when some invalid value does not match existing entity.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.final 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
-
Constructor Details
-
AbstractConstraint
public AbstractConstraint()
-
-
Method Details
-
toString
-
getMessageKey
Description copied from interface:Constraint
Provides the message key.- Specified by:
getMessageKey
in interfaceConstraint
- Returns:
- The message key
-
getErrorMessage
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
-
getMessageString
public static String getMessageString(String bundleName, String key, Object[] params, Locale locale) Try to get the message from the given message bundle. If the bundle is not found or the key is not found, return null.- Since:
- 7.2
-