@groovy.transform.CompileStatic @groovy.util.logging.Slf4j @groovy.transform.ToString(includes: [owningClass, propertyType, propertyName, appliedConstraints]) class DefaultConstrainedProperty extends java.lang.Object implements grails.gorm.validation.ConstrainedProperty
Default implementation of the grails.gorm.validation.ConstrainedProperty interface
Modifiers | Name | Description |
---|---|---|
private static ClassPropertyFetcher |
PROPERTY_FETCHER |
|
protected java.util.Map<java.lang.String, Constraint> |
appliedConstraints |
|
private java.util.Map |
attributes |
|
protected ConstraintRegistry |
constraintRegistry |
|
private boolean |
display |
whether the property should be displayed |
private boolean |
editable |
whether the property is editable |
private java.lang.String |
format |
the format of the property (for example a date pattern) |
private java.util.Map<java.lang.String, java.lang.Object> |
metaConstraints |
|
private int |
order |
The order of the property |
private java.lang.Class<?> |
owningClass |
The owning class |
private boolean |
password |
whether the property is a password |
private java.lang.String |
propertyName |
the property name |
private java.lang.Class<?> |
propertyType |
The property type |
private java.lang.String |
widget |
The widget to use to render the property |
Type | Name and description |
---|---|
java.util.Map |
attributes |
java.util.Map |
attributes |
boolean |
blank |
boolean |
creditCard |
boolean |
display whether the property should be displayed |
boolean |
editable whether the property is editable |
boolean |
email |
java.lang.String |
format the format of the property (for example a date pattern) |
java.util.List |
inList |
java.lang.String |
matches |
java.lang.Comparable |
max |
java.lang.Integer |
maxSize |
java.lang.Comparable |
min |
java.lang.Integer |
minSize |
java.lang.Object |
notEqual |
boolean |
nullable |
int |
order The order of the property |
java.lang.Class<?> |
owningClass The owning class |
boolean |
password whether the property is a password |
java.lang.String |
propertyName the property name |
java.lang.Class<?> |
propertyType The property type |
groovy.lang.Range |
range |
groovy.lang.Range |
size |
boolean |
url |
java.lang.String |
widget The widget to use to render the property |
Constructor and description |
---|
DefaultConstrainedProperty
(java.lang.Class<?> owningClass, java.lang.String propertyName, java.lang.Class<?> propertyType, ConstraintRegistry constraintRegistry) Constructs a new ConstrainedProperty for the given arguments. |
Type Params | Return Type | Name and description |
---|---|---|
|
void |
addMetaConstraint(java.lang.String name, java.lang.Object value) Adds a meta constraints which is a non-validating informational constraint. |
|
void |
applyConstraint(java.lang.String constraintName, java.lang.Object constrainingValue) Applies a constraint for the specified name and consraint value. |
|
protected void |
applyConstraintInternal(java.lang.String constraintName, java.lang.Object constrainingValue) |
|
Constraint |
getAppliedConstraint(java.lang.String name) Obtains an applied constraint by name. |
|
java.util.Collection<Constraint> |
getAppliedConstraints()
|
|
java.util.Map |
getAttributes() |
|
java.util.List |
getInList()
|
|
java.lang.String |
getMatches()
|
|
java.lang.Comparable |
getMax()
|
|
java.lang.Integer |
getMaxSize()
|
|
java.lang.Object |
getMetaConstraintValue(java.lang.String name) Obtains the value of the named meta constraint. |
|
java.util.Map<java.lang.String, java.lang.Object> |
getMetaConstraints()
|
|
java.lang.Comparable |
getMin()
|
|
java.lang.Integer |
getMinSize()
|
|
java.lang.Object |
getNotEqual()
|
|
java.lang.Class |
getOwner() |
|
groovy.lang.Range |
getRange()
|
|
java.lang.Integer |
getScale()
|
|
groovy.lang.Range |
getSize()
|
|
boolean |
hasAppliedConstraint(java.lang.String constraintName)
|
|
private Constraint |
instantiateConstraint(java.lang.String constraintName, java.lang.Object constraintValue, boolean validate) |
|
boolean |
isBlank()
|
|
boolean |
isCreditCard()
|
|
boolean |
isEmail()
|
|
private boolean |
isNotValidStringType() |
|
boolean |
isNullable()
|
|
boolean |
isUrl()
|
|
void |
setAttributes(java.util.Map attributes) |
|
void |
setBlank(boolean blank)
|
|
void |
setCreditCard(boolean creditCard)
|
|
void |
setEmail(boolean email)
|
|
void |
setInList(java.util.List inList)
|
|
void |
setMatches(java.lang.String regex)
|
|
void |
setMax(java.lang.Comparable max)
|
|
void |
setMaxSize(java.lang.Integer maxSize)
|
|
void |
setMin(java.lang.Comparable min)
|
|
void |
setMinSize(java.lang.Integer minSize)
|
|
void |
setNotEqual(java.lang.Object notEqual)
|
|
void |
setNullable(boolean nullable)
|
|
void |
setRange(groovy.lang.Range range)
|
|
void |
setSize(groovy.lang.Range size)
|
|
void |
setUrl(boolean url)
|
|
boolean |
supportsContraint(java.lang.String constraintName) Checks with this ConstraintedProperty instance supports applying the specified constraint. |
|
void |
validate(java.lang.Object target, java.lang.Object propertyValue, org.springframework.validation.Errors errors) Validate this constrainted property against specified property value |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
whether the property should be displayed
whether the property is editable
the format of the property (for example a date pattern)
The order of the property
The owning class
whether the property is a password
the property name
The property type
The widget to use to render the property
whether the property should be displayed
whether the property is editable
the format of the property (for example a date pattern)
The order of the property
The owning class
whether the property is a password
the property name
The property type
The widget to use to render the property
Constructs a new ConstrainedProperty for the given arguments.
owningClass
- The owning classpropertyName
- The name of the propertypropertyType
- The property typeAdds a meta constraints which is a non-validating informational constraint.
name
- The name of the constraintvalue
- The valueApplies a constraint for the specified name and consraint value.
supportsContraint(String constraintName)
to check before callingconstraintName
- The name of the constraintconstrainingValue
- The constraining valueObtains an applied constraint by name.
name
- The name of the constraint
Obtains the value of the named meta constraint.
name
- The name of the constraint
constraintName
- The name of the constraint to check
blank
- The blank to set.
creditCard
- The creditCard to set.
email
- The email to set.
inList
- The inList to set.
regex
- The matches to set.
max
- The max to set.
maxSize
- The maxSize to set.
min
- The min to set.
minSize
- The minLength to set.
notEqual
- The notEqual to set.
nullable
- The nullable to set.
range
- The range to set.
size
- The size to set.
url
- The url to set.Checks with this ConstraintedProperty instance supports applying the specified constraint.
constraintName
- The name of the constraintValidate this constrainted property against specified property value
target
- The target object to validatepropertyValue
- The value of the property to validateerrors
- The Errors instances to report errors toGroovy Documentation