|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.oval.AbstractCheck
net.sf.oval.configuration.annotation.AbstractAnnotationCheck<AssertFieldConstraints>
net.sf.oval.constraint.AssertFieldConstraintsCheck
public class AssertFieldConstraintsCheck
Constructor Summary | |
---|---|
AssertFieldConstraintsCheck()
|
Method Summary | |
---|---|
void |
configure(AssertFieldConstraints constraintAnnotation)
Configures the check based on the given constraint annotation. |
protected ConstraintTarget[] |
getAppliesToDefault()
|
Class<?> |
getDeclaringClass()
|
String |
getErrorCode()
|
String |
getFieldName()
|
String |
getMessage()
gets the default message that is displayed if a corresponding message key is not found in the messages properties file default processed place holders are:
|
int |
getSeverity()
|
boolean |
isSatisfied(Object validatedObject,
Object valueToValidate,
OValContext context,
Validator validator)
This method is not used. |
void |
setDeclaringClass(Class<?> declaringClass)
|
void |
setErrorCode(String errorCode)
|
void |
setFieldName(String fieldName)
|
void |
setMessage(String message)
sets the default message that is displayed if a corresponding message key is not found in the messages properties file default processed place holders are:
|
void |
setSeverity(int severity)
|
Methods inherited from class net.sf.oval.AbstractCheck |
---|
createMessageVariables, getAppliesTo, getContext, getMessageVariables, getProfiles, getTarget, getWhen, isActive, requireMessageVariablesRecreation, setAppliesTo, setContext, setProfiles, setTarget, setWhen |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sf.oval.Check |
---|
getAppliesTo, getContext, getMessageVariables, getProfiles, getTarget, getWhen, isActive, setAppliesTo, setContext, setProfiles, setTarget, setWhen |
Constructor Detail |
---|
public AssertFieldConstraintsCheck()
Method Detail |
---|
public void configure(AssertFieldConstraints constraintAnnotation)
configure
in interface AnnotationCheck<AssertFieldConstraints>
configure
in class AbstractAnnotationCheck<AssertFieldConstraints>
constraintAnnotation
- the constraint annotation to use for configurationprotected ConstraintTarget[] getAppliesToDefault()
getAppliesToDefault
in class AbstractCheck
public Class<?> getDeclaringClass()
public String getErrorCode() throws UnsupportedOperationException
getErrorCode
in interface Check
getErrorCode
in class AbstractCheck
UnsupportedOperationException
public String getFieldName()
public String getMessage() throws UnsupportedOperationException
getMessage
in interface Check
getMessage
in class AbstractCheck
UnsupportedOperationException
public int getSeverity() throws UnsupportedOperationException
getSeverity
in interface Check
getSeverity
in class AbstractCheck
UnsupportedOperationException
public boolean isSatisfied(Object validatedObject, Object valueToValidate, OValContext context, Validator validator) throws UnsupportedOperationException
validatedObject
- the object/bean to validate the value against, for static fields or methods this is the classvalueToValidate
- the value to validate, may be null when validating pre conditions for static methodscontext
- the validation context (e.g. a field, a constructor parameter or a method parameter)validator
- the calling validator
UnsupportedOperationException
- always thrown if this method is invokedpublic void setDeclaringClass(Class<?> declaringClass)
declaringClass
- the declaringClass to setpublic void setErrorCode(String errorCode) throws UnsupportedOperationException
setErrorCode
in interface Check
setErrorCode
in class AbstractCheck
errorCode
- the error code to set
UnsupportedOperationException
public void setFieldName(String fieldName)
fieldName
- the fieldName to setpublic void setMessage(String message) throws UnsupportedOperationException
setMessage
in interface Check
setMessage
in class AbstractCheck
UnsupportedOperationException
public void setSeverity(int severity) throws UnsupportedOperationException
setSeverity
in interface Check
setSeverity
in class AbstractCheck
severity
- the severity to set
UnsupportedOperationException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |