CompilationMessage m = new CompilationMessage(); m.severity = CompilationMessage.ERROR; m.code = ""; m.setSource(sourceLocation); m.messageText = "Incompatible copy error: " + toType2 + " := " + fromType2 + " simplified: " + toType3 + " := " + fromType3 + " expression: " + expr; throw new CompilationException(m);
public CompilationException(CompilationMessage msg, Throwable cause) { super(msg.toErrorString(),cause); _msg = msg; } /**
@SuppressWarnings("unchecked") private ActivityGenerator findActivityGen(Activity source) { Class actClass = source.getClass(); for (Map.Entry<Class, ActivityGenerator> me : _actGenerators.entrySet()) { Class<?> cls = me.getKey(); if (cls.isAssignableFrom(actClass)) { ActivityGenerator gen = me.getValue(); gen.setContext(this); return gen; } } throw new CompilationException(__cmsgs.errUnknownActivity(actClass.getName()).setSource(source)); }
CompilationMessage cmsg = new CompilationMessage(); cmsg.severity = severity; cmsg.phase = 0;
public void compile(OActivity output, Activity src) { FlowActivity flowAct = (FlowActivity)src; OFlow oflow = (OFlow) output; compileLinkDecls(oflow, flowAct); compileChildren(oflow, flowAct); for (Iterator<OLink> i = oflow.localLinks.iterator(); i.hasNext(); ) { OLink olink = i.next(); try { if (olink.source == null) throw new CompilationException(__cmsgs.errLinkMissingSourceActivity(olink.name).setSource(flowAct)); } catch (CompilationException ce) { _context.recoveredFromError(src, ce); } try { if (olink.target == null) throw new CompilationException(__cmsgs.errLinkMissingTargetActivity(olink.name).setSource(flowAct)); } catch (CompilationException ce) { _context.recoveredFromError(src, ce); } } }
private void recover(short severity, TransformerException exception) { CompilationMessage cmsg = new CompilationMessage(); cmsg.severity = severity; cmsg.code = "parseXsl"; cmsg.phase = 0; cmsg.messageText = exception.getMessageAndLocation(); CompilationException ce = new CompilationException(cmsg, exception); SourceLocation loc = exception.getLocator() != null ? new SourceLocatorWrapper(exception.getLocator()) : null; if (_cc != null) _cc.recoveredFromError(loc,ce); else __log.error("XSL stylesheet parsing error! ", exception); } }
protected void compileChildren(OSequence dest, CompositeActivity src) { if (src.getActivities().size() == 0) throw new CompilationException(__cmsgs.errEmptySequence().setSource(src)); for (Activity child : src.getActivities()) { try { OActivity compiledChild = _context.compile(child); dest.sequence.add(compiledChild); } catch (CompilationException ce) { _context.recoveredFromError(child, ce); } } }
CompilationMessage m = new CompilationMessage(); m.severity = CompilationMessage.ERROR; m.code = ""; m.setSource(sourceLocation); m.messageText = errors.toString(); __log.debug(m + " query: " + query + " errors " + errors);
public String toString() { return "CompilationMessage: " + toErrorString(); }
CompilationMessage cmsg = __cmsgs.errBpelParseErr().setSource(new SourceLocationImpl(bpelFile.toURI())); this.invalidate(); throw new CompilationException(cmsg, e);
public String toErrorMessage() { return _msg.toErrorString(); }
__cmsgs.errSchemaError(ex.getDetailMessage()).setSource(new SourceLocationImpl(defuri))); if (_ctx != null) _ctx.recoveredFromError(new SourceLocationImpl(defuri),ce);
/** * Log a compilation message, both to the log, and to the listener (if any). * @param cmsg */ private void logCompilationMessage(CompilationMessage cmsg) { if (_compileListener != null) { _compileListener.onCompilationMessage(cmsg); } else { switch (cmsg.severity) { case CompilationMessage.ERROR: if (__log.isErrorEnabled()) __log.error(cmsg.toErrorString()); break; case CompilationMessage.INFO: if (__log.isInfoEnabled()) __log.info(cmsg.toErrorString()); break; case CompilationMessage.WARN: if (__log.isWarnEnabled()) __log.warn(cmsg.toErrorString()); } } }
private OProcess.OProperty compile(Property property) { OProcess.OProperty oproperty = new OProcess.OProperty(_oprocess); oproperty.name = property.getName(); oproperty.debugInfo = createDebugInfo(_processDef, "Property " + property.getName()); if (!_wsdlRegistry.getSchemaModel().isSimpleType(property.getPropertyType())) throw new CompilationException(__cmsgs.errPropertyDeclaredWithComplexType(property.getName(), property.getPropertyType()).setSource(property)); _oprocess.properties.add(oproperty); if (__log.isDebugEnabled()) __log.debug("Compiled property " + oproperty); return oproperty; }
public void onCompilationMessage(CompilationMessage m) { if (m.severity >= _minSeverity) { _cc.outln(m.toErrorString()); } if (_compileListener != null) { _compileListener.onCompilationMessage(m); } } };
public void run() { compileLinks(source); for (OScope.Variable v : variables) { v.declaringScope = implicitScope; implicitScope.addLocalVariable(v); } if (source instanceof ScopeActivity) { Activity scopeChild = ((ScopeActivity) source).getChildActivity(); if (scopeChild == null) throw new CompilationException(__cmsgs.errEmptyScope().setSource(source)); implicitScope.activity = compile(scopeChild); } else { implicitScope.activity = compileActivity(false, source); } } });
hasErrors = true; sb.append('\t'); sb.append(msg.toErrorString()); sb.append('\n');
private void compileLinkTarget(LinkTarget target) { OLink ol = resolveLink(target.getLinkName()); assert ol != null; ol.debugInfo = createDebugInfo(target, target.toString()); if (ol.target != null) throw new CompilationException(__cmsgs.errDuplicateLinkTarget(target.getLinkName()).setSource(target)); ol.target = _structureStack.topActivity(); _structureStack.topActivity().targetLinks.add(ol); }
CompilationException ce = new CompilationException( __cmsgs.errWsdlImportNotFound(im.getNamespaceURI(), im.getLocationURI()).setSource(new SourceLocationImpl(defuri))); if (_ctx == null) throw ce;
try { if (imprt.getImportType() == null) throw new CompilationException(__cmsgs.errUnspecifiedImportType().setSource(imprt)); throw new CompilationException(__cmsgs.errMissingImportLocation().setSource(imprt)); addXsdImport(current, imprt.getLocation(), imprt); } else throw new CompilationException(__cmsgs.errUnknownImportType(imprt.getImportType()).setSource(imprt)); } catch (CompilationException ce) { if (ce.getCompilationMessage().source == null) ce.getCompilationMessage().setSource(imprt); throw ce;