//ValidatableObject vo = Util.toValidatableObject(o);
ValidatableObject vo = jaxbContext.getGrammarInfo().castToValidatableObject(o);
if(vo==null)
throw new ValidationException(
Messages.format( Messages.NOT_VALIDATABLE ) );
EventInterceptor ei = new EventInterceptor(eventHandler);
ValidationContext context = new ValidationContext(jaxbContext,ei,validateId);
context.validate(vo);
context.reconcileIDs();
return !ei.hadError();
} catch( SAXException e ) {
// TODO exception handling.
// we need a consistent mechanism to convert SAXException into JAXBException
Exception nested = e.getException();
if( nested != null ) {
throw new ValidationException( nested );
} else {
throw new ValidationException( e );
}
//return false;
}
}