hi
I'm trying to create a validator for a Set<T>, like that :
Code:
SampleClass<T extends Foo> implements SampleInterface<T>{
@CustomValidOnGenericSet
private Set<T> foos = new HashSet<T>();
}
However, I don't manage to reflect this generic type in the validator.
The only working solution I found was to completely skip the generic part:
Code:
public class CustomValidOnGenericSetValidator implements ConstraintValidator<MyValidator, Set>
this looks pretty poor, is there a way I could do it cleanly ?
If not, does it mean that it I wanted to add a validator on some generic a field, then I would have to create a validator on top of Object ?
In code, this would mean :
Code:
SampleClass<T extends Foo> implements SampleInterface<T>{
@CustomValid
private T initialT;
}
class CustomValidator implements ConstraintValidator<MyValidator, Object>{
...
}
thanks in advance
best regards
zedros