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 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:
  • Constructor Details

    • AbstractConstraint

      public AbstractConstraint()
  • Method Details

    • toString

      public final String toString()
      Overrides:
      toString in class Object
    • getMessageKey

      public String getMessageKey()
      Description copied from interface: Constraint
      Provides the message key.
      Specified by:
      getMessageKey in interface Constraint
      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 interface Constraint
      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