|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.codehaus.groovy.grails.validation.AbstractConstraint
public abstract class AbstractConstraint extends java.lang.Object
Abstract class for constraints to extend.
Field Summary | |
---|---|
protected java.lang.String |
classShortName
|
protected java.lang.Class |
constraintOwningClass
|
protected java.lang.Object |
constraintParameter
|
protected java.lang.String |
constraintPropertyName
|
protected org.springframework.context.MessageSource |
messageSource
|
Method Summary | |
---|---|
protected void
|
checkState()
|
protected java.lang.String
|
getDefaultMessage(java.lang.String code)
Returns the default message for the given message code in the current locale. |
java.lang.Object
|
getParameter()
|
java.lang.String
|
getPropertyName()
|
boolean
|
isValid()
Return whether the constraint is valid for the owning class |
protected void
|
processValidate(java.lang.Object target, java.lang.Object propertyValue, org.springframework.validation.Errors errors)
|
void
|
rejectValue(java.lang.Object target, org.springframework.validation.Errors errors, java.lang.String defaultMessageCode, java.lang.Object[] args)
|
void
|
rejectValue(java.lang.Object target, org.springframework.validation.Errors errors, java.lang.String defaultMessageCode, java.lang.String code, java.lang.Object[] args)
|
void
|
rejectValue(java.lang.Object target, org.springframework.validation.Errors errors, java.lang.String defaultMessageCode, java.lang.String[] codes, java.lang.Object[] args)
|
void
|
rejectValue(java.lang.Object target, org.springframework.validation.Errors errors, java.lang.String code, java.lang.String defaultMessage)
|
void
|
rejectValue(java.lang.Object target, org.springframework.validation.Errors errors, java.lang.String code, java.lang.Object[] args, java.lang.String defaultMessage)
|
void
|
rejectValueWithDefaultMessage(java.lang.Object target, org.springframework.validation.Errors errors, java.lang.String defaultMessage, java.lang.String[] codes, java.lang.Object[] args)
|
void
|
setMessageSource(org.springframework.context.MessageSource source)
|
void
|
setOwningClass(java.lang.Class constraintOwningClass)
{@inheritDoc} |
void
|
setParameter(java.lang.Object constraintParameter)
@param constraintParameter The constraintParameter to set. |
void
|
setPropertyName(java.lang.String constraintPropertyName)
@param constraintPropertyName The constraintPropertyName to set. |
protected boolean
|
skipBlankValues()
|
protected boolean
|
skipNullValues()
|
java.lang.String
|
toString()
|
void
|
validate(java.lang.Object target, java.lang.Object propertyValue, org.springframework.validation.Errors errors)
|
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), 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() |
Field Detail |
---|
protected java.lang.String classShortName
protected java.lang.Class constraintOwningClass
protected java.lang.Object constraintParameter
protected java.lang.String constraintPropertyName
protected org.springframework.context.MessageSource messageSource
Method Detail |
---|
protected void checkState()
protected java.lang.String getDefaultMessage(java.lang.String code)
code
- The i18n message code to look up.
public java.lang.Object getParameter()
public java.lang.String getPropertyName()
public boolean isValid()
protected void processValidate(java.lang.Object target, java.lang.Object propertyValue, org.springframework.validation.Errors errors)
public void rejectValue(java.lang.Object target, org.springframework.validation.Errors errors, java.lang.String defaultMessageCode, java.lang.Object[] args)
public void rejectValue(java.lang.Object target, org.springframework.validation.Errors errors, java.lang.String defaultMessageCode, java.lang.String code, java.lang.Object[] args)
public void rejectValue(java.lang.Object target, org.springframework.validation.Errors errors, java.lang.String defaultMessageCode, java.lang.String[] codes, java.lang.Object[] args)
public void rejectValue(java.lang.Object target, org.springframework.validation.Errors errors, java.lang.String code, java.lang.String defaultMessage)
public void rejectValue(java.lang.Object target, org.springframework.validation.Errors errors, java.lang.String code, java.lang.Object[] args, java.lang.String defaultMessage)
public void rejectValueWithDefaultMessage(java.lang.Object target, org.springframework.validation.Errors errors, java.lang.String defaultMessage, java.lang.String[] codes, java.lang.Object[] args)
public void setMessageSource(org.springframework.context.MessageSource source)
@SuppressWarnings("rawtypes") public void setOwningClass(java.lang.Class constraintOwningClass)
public void setParameter(java.lang.Object constraintParameter)
constraintParameter
- The constraintParameter to set.
public void setPropertyName(java.lang.String constraintPropertyName)
constraintPropertyName
- The constraintPropertyName to set.
protected boolean skipBlankValues()
protected boolean skipNullValues()
@Override public java.lang.String toString()
public void validate(java.lang.Object target, java.lang.Object propertyValue, org.springframework.validation.Errors errors)
Groovy Documentation