📄 javasemanticcompileerror.java
字号:
package org.drools.semantics.java;
import org.apache.commons.jci.problems.CompilationProblem;
/**
* This exception gets thrown when there is an actual error compiling a java semantic components.
* Errors are passed back from JCI.
*
* @author <a href="mailto:michael.neale@gmail.com"> Michael Neale</a>
*/
public class JavaSemanticCompileError extends RuntimeException {
private static final long serialVersionUID = 34846969604394084L;
private CompilationProblem[] errors;
private String summaryMessage;
public JavaSemanticCompileError(CompilationProblem[] errors) {
this.errors = errors;
StringBuffer buf = new StringBuffer();
buf.append("A problem occured compiling the embedded code: \n");
constructMessage( errors,
buf );
this.summaryMessage = buf.toString();
System.err.println( this.summaryMessage );
}
public CompilationProblem[] getErrors() {
return this.errors;
}
private void constructMessage(CompilationProblem[] errors,
StringBuffer buf) {
for ( int i = 0; i < errors.length; i++ ) {
String errorSummary = errors[i].getFileName() + "(" + errors[i].getStartLine() + ")" + "\n" + errors[i].getMessage();
buf.append(errorSummary + " \n");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -