public final class ObjectResolverConstraint extends AbstractConstraint
getResolver()
.Constraint.Description
MESSAGES_BUNDLE, MESSAGES_DEFAULT_LANG, MESSAGES_KEY
Constructor and Description |
---|
ObjectResolverConstraint(ObjectResolver resolver) |
Modifier and Type | Method and Description |
---|---|
Constraint.Description |
getDescription()
Provides a description of a constraint.
|
String |
getErrorMessage(Object invalidValue,
Locale locale)
Provides an error message to display when some invalid value does not match existing entity.
|
ObjectResolver |
getResolver() |
boolean |
validate(Object object)
Validates the given object against this constraint.
|
getMessageString, toString
public ObjectResolverConstraint(ObjectResolver resolver)
public ObjectResolver getResolver()
public boolean validate(Object object)
Constraint
If some object is null. Constraint should return true while validating unless the constraint deals with nullable state.
object
- the object to validatepublic Constraint.Description getDescription()
Constraint
name=PatternMatchingConstraint
| parameters= "pattern":"[0-9]+"
public String getErrorMessage(Object invalidValue, Locale locale)
Constraint
getErrorMessage
in interface Constraint
getErrorMessage
in class AbstractConstraint
invalidValue
- The invalid value that don't match any entity.locale
- The language in which the message should be generated.Copyright © 2018 Nuxeo. All rights reserved.