Adding validation errors (and handling exceptions) in JvmModelInferrer [message #937891] |
Tue, 09 October 2012 10:54 |
Alexey Romanov Messages: 263 Registered: May 2010 |
Senior Member |
|
|
How can I add validation errors found while trying to infer the JVM model (after cross-indexing, so they can't be checked in the validator)? I've tried injecting first ValidationMessageAcceptor (which couldn't be found) and then IDLJavaValidator. But it inherits this implementation from AbstractDeclarativeValidator:
public void acceptError(String message, EObject object, EStructuralFeature feature, int index, String code, String... issueData) {
this.state.get().hasErrors = true;
state.get().chain.add(createDiagnostic(Severity.ERROR, message, object, feature, index, code, issueData));
}
and state.get() returns null. While I've found I could initialize the state threadLocal by doing validation.setMessageAcceptor(validation).getState() 1) this is obviously wrong 2) it still didn't work because state.get().chain was null.
So is there a proper mechanism for reporting errors from inferring the model?
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02156 seconds