コード例 #1
0
 @Override
 public void accept(ISerializationDiagnostic diagnostic) {
   if (diagnostic == null || diagnostic.getMessage() == null)
     throw new RuntimeException("Something went wrong during serialization");
   else if (diagnostic.getException() != null)
     throw new RuntimeException(diagnostic.getException());
   else {
     String msg = diagnostic.getMessage();
     if (diagnostic.getSemanticObject() != null)
       msg += "\nSemantic Object: " + EmfFormatter.objPath(diagnostic.getSemanticObject());
     if (diagnostic.getContext() != null)
       msg += "\nContext: " + new Context2NameFunction().getContextName(diagnostic.getContext());
     throw new RuntimeException(msg);
   }
 }
コード例 #2
0
 @Override
 public void accept(ISerializationDiagnostic diagnostic) {
   if (diagnostic == null || diagnostic.getMessage() == null) System.err.println("error");
   else System.err.println("error " + diagnostic.getMessage());
 }