Class PatternConstraint
java.lang.Object
org.nuxeo.ecm.core.schema.types.constraints.AbstractConstraint
org.nuxeo.ecm.core.schema.types.constraints.PatternConstraint
- All Implemented Interfaces:
Serializable
,Constraint
This constraint ensures some object's String representation match a pattern.
- 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 TypeMethodDescriptionboolean
Here, value is :
name = "PatternConstraint"
parameters = "Pattern" : [0-9]+getErrorMessage
(Object invalidValue, Locale locale) Provides an error message to display when some invalid value does not match existing entity.int
hashCode()
boolean
Validates the given object against this constraint.Methods inherited from class org.nuxeo.ecm.core.schema.types.constraints.AbstractConstraint
getMessageKey, getMessageString, toString
-
Field Details
-
pattern
-
-
Constructor Details
-
PatternConstraint
-
-
Method Details
-
validate
Description copied from interface:Constraint
Validates the given object against this constraint.If some object is null. Constraint should return true while validating unless the constraint deals with nullable state.
- Parameters:
object
- the object to validate- Returns:
- true if the object was successfully validated, false otherwise
-
getDescription
Here, value is :
name = "PatternConstraint"
parameters =- "Pattern" : [0-9]+
- Returns:
- The constraint description.
-
getPattern
- Returns:
- The pattern used by this constraint to validate.
- Since:
- 7.1
-
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
- Overrides:
getErrorMessage
in classAbstractConstraint
- 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
-
hashCode
public int hashCode() -
equals
-