org.javalid.annotations.core
Annotation Type ValidateDefinition


@Target(value=TYPE)
@Retention(value=RUNTIME)
@Documented
@Inherited
public @interface ValidateDefinition

Core annotation which must be defined on class level for each class you wish in one way or another to do validation on.

TODO: NOT YET IMPLEMENTED ->
forceDoubleValidation can be overridden when calling through the AnnotationValidator.
If special validation is used on a class, it can be disabled through the AnnotationValidator (thus only performing ordinary group validation). Please note that you should use these options only and only if no other choice (it can be confusing!).

Since:
1.0
Version:
1.1
Author:
M.Reuvers

Optional Element Summary
 boolean forceDoubleValidation
          This property is ONLY used in conjunction with validationType=TYPE_LOOKUP or TYPE_BEAN.
 Lookup lookup
          Set if validationType = TYPE_LOOKUP.
 java.lang.String primaryGroup
          The name of the group to validate when no group is specified through the validator.
 int validationType
          What type of validation to apply to annotated class.
 

primaryGroup

public abstract java.lang.String primaryGroup
The name of the group to validate when no group is specified through the validator.

Defaults to "1", the same as JvGroup defaults too, making it easy for you if you need quick validation and don't want to write any group anywhere.

Default:
"1"

validationType

public abstract int validationType
What type of validation to apply to annotated class. The following options are supported:

1) TYPE_NORMAL (performs normal validation)
2) TYPE_LOOKUP (performs validation through a lookup such as spring or a javabean), use @Lookup then.

You can force applying both the group rules and special validation by setting the property: forceDoubleValidation to true (default is false).

Defaults to TYPE_NORMAL.

Note: For TYPE_LOOKUP you must use @Lookup.

Default:
0

forceDoubleValidation

public abstract boolean forceDoubleValidation
This property is ONLY used in conjunction with validationType=TYPE_LOOKUP or TYPE_BEAN. In that case setting this to true means that an object is validated by both the 'group' validation AND its special lookup validation. Normally only special validation is applied when it is set to false. Settting this to true forces 'double' validation.

Defaults to false.

Default:
false

lookup

public abstract Lookup lookup
Set if validationType = TYPE_LOOKUP.

Defaults to empty lookup, through this one you can specify what lookup you wish to use (bean, spring ..)

See Also:
Lookup
Default:
@org.javalid.annotations.helper.Lookup