Interface DefaultGroupSequenceProvider<T>
- Type Parameters:
T- The type for which an implementation is defined.
In order to dynamically redefine the default group sequence for a type T,
the GroupSequenceProvider annotation
must be placed on T, specifying as its value a concrete implementation of DefaultGroupSequenceProvider, which
must be parametrized with that same type T, its subclass Y (T t; t instanceof Y == true
or an interface I that is common to the beans on for which this sequence provider is expected to be applied to.
If during the validation process the Default group is validated for T, the actual validated instance
is passed to the DefaultGroupSequenceProvider to determine the default group sequence.
Note:
- Implementations must provide a public default constructor.
- Implementations must be thread-safe.
- Implementations must return a valid default group sequence,
i.e. the returned sequence must contain the bean type itself,
which represents the
default group.
- Author:
- Kevin Pollet <kevin.pollet@serli.com> (C) 2011 SERLI, Hardy Ferentschik
-
Method Summary
Modifier and TypeMethodDescriptiongetValidationGroups(Class<?> klass, T object) This method returns the default group sequence for the givenklassbean type andobjectinstance.getValidationGroups(T object) Deprecated, for removal: This API element is subject to removal in a future version.
-
Method Details
-
getValidationGroups
This method returns the default group sequence for the givenklassbean type andobjectinstance.The object parameter allows to dynamically compose the default group sequence based on the state of the validated value.
- Parameters:
klass- the type of the bean for which the group sequence is requested.object- the instance under validation. This value can benull, e.g. in case this method was called as part of Validator#validateValue.- Returns:
- a list of classes specifying the default group sequence. The same constraints to the redefined group list
apply as for lists defined via
GroupSequence. In particular the list has to contain the type T.
-
getValidationGroups
Deprecated, for removal: This API element is subject to removal in a future version.Use thegetValidationGroups(Class, Object)instead.This method returns the default group sequence for the given instance.The object parameter allows to dynamically compose the default group sequence in function of the validated value state.
- Parameters:
object- the instance being validated. This value can benullin case this method was called as part of Validator#validateValue.- Returns:
- a list of classes specifying the default group sequence. The same constraints to the redefined group list
apply as for lists defined via
GroupSequence. In particular the list has to contain the type T.
-
getValidationGroups(Class, Object)instead.