Hi,
Suppose the following class
public class Message {
// some code
}
And a Spring Validator implementation (no Spring knowledge required)
public class MessageValidator implements Validator {
public boolean supports(Class clazz) {
if(clazz.isAssignableFrom(Message.class))
return true;
else if(<ANSWER>)
return true;
return false;
}
public void validate(Object command, Errors errorArray) {
if(command instanceof List)
for(Message message: (List) command)
validateMessage(message);
else
validateMessage((Message) command);
}
public void validateMessage(Message message, Errors errorArray) {
// do validation Message object
}
}
Notice supports method. What to put in <ANSWER> in order to support a List of Message - List<Message> ?
regards,