IUnmarshallingContext ictx =
m_bindingFactory.createUnmarshallingContext();
ValidationContext vctx = new ValidationContext();
ictx.setDocument(is, null);
ictx.setUserContext(vctx);
GlobalCustom global = (GlobalCustom)ictx.unmarshalElement();
List problems = vctx.getProblems();
if (problems.size() > 0) {
StringBuffer buff = new StringBuffer();
for (int i = 0; i < problems.size(); i++) {
ValidationProblem prob = (ValidationProblem)problems.get(i);
buff.append(prob.getSeverity() >=
ValidationProblem.ERROR_LEVEL ? "Error: " : "Warning: ");
buff.append(prob.getDescription());
buff.append('\n');
}
fail(buff.toString());
}
global.fillClasses();
return global;
}