Package org.codehaus.groovy.control.messages

Examples of org.codehaus.groovy.control.messages.ExceptionMessage


                Object ret = method.invoke(null, new Object[]{javacParameters});
                javacReturnValue = ((Integer) ret).intValue();
            }
            cu.getConfiguration().getOutput();
        } catch (InvocationTargetException ite) {
            cu.getErrorCollector().addFatalError(new ExceptionMessage((Exception) ite.getCause(), true, cu));
        } catch (Exception e) {
            cu.getErrorCollector().addFatalError(new ExceptionMessage(e, true, cu));
        }
        if (javacReturnValue!=0) {
            switch (javacReturnValue) {
                case 1: addJavacError("Compile error during compilation with javac.",cu,javacOutput); break;
                case 2: addJavacError("Invalid commandline usage for javac.",cu,javacOutput); break;
View Full Code Here


            cls = loader.loadClass(name, false, true);
        } catch (ClassNotFoundException cnfe) {
            cachedClasses.put(name, SCRIPT);
            return false;
        } catch (CompilationFailedException cfe) {
            compilationUnit.getErrorCollector().addErrorAndContinue(new ExceptionMessage(cfe, true, source));
            return false;
        }
        //TODO: the case of a NoClassDefFoundError needs a bit more research
        // a simple recompilation is not possible it seems. The current class
        // we are searching for is there, so we should mark that somehow.
View Full Code Here

        failIfErrors();
    }


    public void addException(Exception cause, SourceUnit source) throws CompilationFailedException {
        addError(new ExceptionMessage(cause,configuration.getDebug(),source));
        failIfErrors();
    }
View Full Code Here

                }

                if (nestedCollector != null) {
                    getErrorCollector().addCollectorContents(nestedCollector);
                } else {
                    getErrorCollector().addError(new ExceptionMessage(e, configuration.getDebug(), this));
                }
            }
        }

        getErrorCollector().failIfErrors();
View Full Code Here

                        if (message.indexOf("@") > 0) {
                            message = message.substring(0, message.lastIndexOf("@"));
                        }
                        throw new TemplateCompilationException(this, line, message);
                    } else{
                        ExceptionMessage  errorMessage = (ExceptionMessage ) e.getErrorCollector().getLastError();
                        Exception exception = errorMessage.getCause();
                        Integer line = 0;
                        String message = exception.getMessage();
                        throw new TemplateCompilationException(this, line, message);
                    }
                }
View Full Code Here

                Object ret = method.invoke(null, new Object[]{javacParameters});
                javacReturnValue = (Integer) ret;
            }
            cu.getConfiguration().getOutput();
        } catch (InvocationTargetException ite) {
            cu.getErrorCollector().addFatalError(new ExceptionMessage((Exception) ite.getCause(), true, cu));
        } catch (Exception e) {
            cu.getErrorCollector().addFatalError(new ExceptionMessage(e, true, cu));
        }
        if (javacReturnValue != 0) {
            switch (javacReturnValue) {
                case 1: addJavacError("Compile error during compilation with javac.", cu, javacOutput); break;
                case 2: addJavacError("Invalid commandline usage for javac.", cu, javacOutput); break;
View Full Code Here

        if (nestedCollector != null) {
            getErrorCollector().addCollectorContents(nestedCollector);
        } else {
            Exception err = e instanceof Exception?((Exception)e):new RuntimeException(e);
            getErrorCollector().addError(new ExceptionMessage(err, configuration.getDebug(), this));
        }
    }
View Full Code Here

        failIfErrors();
    }


    public void addException(Exception cause, SourceUnit source) throws CompilationFailedException {
        addError(new ExceptionMessage(cause,configuration.getDebug(),source));
        failIfErrors();
    }
View Full Code Here

                    Class klass = loadTransformClass(className, aliasNode);
                    if (klass!=null) {
                        try {
                            act = (AnnotationCollectorTransform) klass.newInstance();
                        } catch (InstantiationException e) {
                            source.getErrorCollector().addErrorAndContinue(new ExceptionMessage(e, true, source));
                        } catch (IllegalAccessException e) {
                            source.getErrorCollector().addErrorAndContinue(new ExceptionMessage(e, true, source));
                        }
                    }
                } else {
                    act = new AnnotationCollectorTransform();
                }
View Full Code Here

                }

                if (nestedCollector != null) {
                    getErrorCollector().addCollectorContents(nestedCollector);
                } else {
                    getErrorCollector().addError(new ExceptionMessage(e, configuration.getDebug(), this));
                }
            }
        }

        getErrorCollector().failIfErrors();
View Full Code Here

TOP

Related Classes of org.codehaus.groovy.control.messages.ExceptionMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.