|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.javalid.core.AnnotationStorage
public class AnnotationStorage
Class for putting everything together, related to a method / field for validation.
| Constructor Summary | |
|---|---|
AnnotationStorage(java.lang.reflect.Method method,
java.lang.reflect.Field field,
java.lang.String groupName,
java.lang.String path,
java.util.List<java.lang.annotation.Annotation> annotations,
java.util.List<JvGroup> listGroups)
Construct this object. |
|
| Method Summary | |
|---|---|
java.util.List<java.lang.annotation.Annotation> |
getAnnotations()
|
java.lang.reflect.Field |
getField()
|
java.lang.String |
getGroupName()
|
java.lang.reflect.Method |
getMethod()
|
NotEmpty |
getNotEmptyAnnotation()
Convenience method to directly get the NotEmpty annotation on this method. |
NotNull |
getNotNullAnnotation()
Convenience method to directly get the NotNull annotation on this method. |
java.lang.String |
getPath()
|
protected void |
init()
Initializes everything, called from constructor. |
boolean |
isAnnotationValidated(java.lang.annotation.Annotation annotation)
Returns true if given annotation-class has already been validated on the method's value (so there's no need to validate them twice). |
boolean |
isRecursionAllowed(java.lang.String group)
Returns true if recursion for this group is allowed, false if it is not. |
void |
setAnnotationValidated(java.lang.annotation.Annotation annotation,
boolean validated,
boolean validatedValid)
Change the validation for a fully qualified annotation class name |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AnnotationStorage(java.lang.reflect.Method method,
java.lang.reflect.Field field,
java.lang.String groupName,
java.lang.String path,
java.util.List<java.lang.annotation.Annotation> annotations,
java.util.List<JvGroup> listGroups)
method - The method to apply validation to (can be null, but then field must be set)field - The field to apply validation to (can be null, but then method must be set)path - Full path (with prefix if there) when validating, the methodName of this method must be added. e.g. person.value (where person
is the current path and .value the current method)groupName - The groupName currently under validationannotations - The annotations that were found on either method or field with the same group name as the groups.
Annotations with no groupnames will always be included as they apply to all groups then.listGroups - The group annotations found on the methods, the first entry always contains the method
that was being validated, use that one to determine if recursion is allowed or not.| Method Detail |
|---|
protected void init()
public java.lang.String getGroupName()
public java.lang.String getPath()
public java.lang.reflect.Method getMethod()
public java.util.List<java.lang.annotation.Annotation> getAnnotations()
public NotNull getNotNullAnnotation()
public NotEmpty getNotEmptyAnnotation()
public boolean isAnnotationValidated(java.lang.annotation.Annotation annotation)
annotation - The validation annotation
public void setAnnotationValidated(java.lang.annotation.Annotation annotation,
boolean validated,
boolean validatedValid)
annotation - The validation annotationvalidated - Set to true if the annotation is validated, false otherwise.validatedValid - Set to true if no error was found, false otherwise. Note that if parameter
validated is false, this parameter is ignored.public boolean isRecursionAllowed(java.lang.String group)
group - The group to check
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.reflect.Field getField()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||