|
||||||||||
PREV CLASS NEXT CLASS | 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
Field Summary | |
---|---|
protected String |
classShortName
|
protected Class |
constraintOwningClass
|
protected Object |
constraintParameter
|
protected String |
constraintPropertyName
|
protected MessageSource |
messageSource
|
Constructor Summary | |
---|---|
AbstractConstraint()
|
Method Summary | |
---|---|
protected void |
checkState()
|
protected String |
getDefaultMessage(String code)
Returns the default message for the given message code in the current locale. |
String |
getPropertyName()
|
protected abstract void |
processValidate(Object target,
Object propertyValue,
Errors errors)
|
void |
rejectValue(Object target,
Errors errors,
String defaultMessageCode,
Object[] args)
|
void |
rejectValue(Object target,
Errors errors,
String code,
Object[] args,
String defaultMessage)
|
void |
rejectValue(Object target,
Errors errors,
String code,
String defaultMessage)
|
void |
rejectValue(Object target,
Errors errors,
String defaultMessageCode,
String[] codes,
Object[] args)
|
void |
rejectValue(Object target,
Errors errors,
String defaultMessageCode,
String code,
Object[] args)
|
void |
rejectValueWithDefaultMessage(Object target,
Errors errors,
String defaultMessage,
String[] codes,
Object[] args)
|
void |
setMessageSource(MessageSource source)
The message source to evaluate the default messages from |
void |
setOwningClass(Class constraintOwningClass)
The class the constraint applies to |
void |
setParameter(Object constraintParameter)
The parameter which the constraint is validated against |
void |
setPropertyName(String constraintPropertyName)
The name of the property the constraint applies to |
protected boolean |
skipNullValues()
|
String |
toString()
|
void |
validate(Object target,
Object propertyValue,
Errors errors)
Validate this constraint against a property value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.codehaus.groovy.grails.validation.Constraint |
---|
getName, supports |
Field Detail |
---|
protected String constraintPropertyName
protected Class constraintOwningClass
protected Object constraintParameter
protected String classShortName
protected MessageSource messageSource
Constructor Detail |
---|
public AbstractConstraint()
Method Detail |
---|
public void setMessageSource(MessageSource source)
Constraint
setMessageSource
in interface Constraint
public String getPropertyName()
getPropertyName
in interface Constraint
public void setOwningClass(Class constraintOwningClass)
Constraint
setOwningClass
in interface Constraint
constraintOwningClass
- The constraintOwningClass to set.public void setPropertyName(String constraintPropertyName)
Constraint
setPropertyName
in interface Constraint
constraintPropertyName
- The constraintPropertyName to set.public void setParameter(Object constraintParameter)
Constraint
setParameter
in interface Constraint
constraintParameter
- The constraintParameter to set.protected void checkState()
public void validate(Object target, Object propertyValue, Errors errors)
Constraint
validate
in interface Constraint
propertyValue
- The property value to validateerrors
- The errors instance to record errors againstprotected boolean skipNullValues()
public void rejectValue(Object target, Errors errors, String defaultMessageCode, Object[] args)
public void rejectValue(Object target, Errors errors, String defaultMessageCode, String code, Object[] args)
public void rejectValue(Object target, Errors errors, String defaultMessageCode, String[] codes, Object[] args)
public void rejectValueWithDefaultMessage(Object target, Errors errors, String defaultMessage, String[] codes, Object[] args)
public void rejectValue(Object target, Errors errors, String code, String defaultMessage)
public void rejectValue(Object target, Errors errors, String code, Object[] args, String defaultMessage)
protected String getDefaultMessage(String code)
code
- The i18n message code to look up.
protected abstract void processValidate(Object target, Object propertyValue, Errors errors)
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |