Hello,
i have requirement to do xml schema validation, but in case of problem
only to log it, but continue serialization/deserialization. This is
beacause after enabling validation we found that some clients are not
sending requests valid against schema (e.g. are not sending elements,
instead of sending nil atribute, or are sending elements in wrong order
etc). So we want to log all such problems and tell then client developer
where are problems....
I did following:
in JaxBEncoderDecoder i set
u.setEventHandler(validationEventHandler);
after each
u.setSchema(schema);
and declared (this will be extended):
private static final ValidationEventHandler validationEventHandler =
new ValidationEventHandler() {
public boolean handleEvent(ValidationEvent event) {
LOG.log(Level.SEVERE, "Validation Error:
[severity="+event.getSeverity()+", message='"+event.getMessage()+"',
location='"+event.getLocator()+"'].", event.getLinkedException());
return true;
}
};
my question is if i can in general return true from handleEvent method.
Because i'm afraid, that this method is called also in case of different
errors
best regards
jano