Package groovy.lang

Examples of groovy.lang.GroovyRuntimeException


    private void visit(Closure closure, CodeVisitorSupport visitor) {
        if (closure != null) {
            ClassNode classNode = closure.getMetaClass().getClassNode();
            if (classNode == null) {
                throw new GroovyRuntimeException(
                        "Could not find the ClassNode for MetaClass: " + closure.getMetaClass());
            }
            List methods = classNode.getDeclaredMethods("doCall");
            if (!methods.isEmpty()) {
                MethodNode method = (MethodNode) methods.get(0);
View Full Code Here


    public void println(String text) {
        try {
            out.write(text);
            println();
        } catch(IOException ioe) {
            throw new GroovyRuntimeException(ioe);
        }
    }
View Full Code Here

     */
    public void print(String text) {
        try {
            out.write(text);
        } catch(IOException ioe) {
            throw new GroovyRuntimeException(ioe);
        }
    }
View Full Code Here

     */
    public void print(char c) {
        try {
            out.write(c);
        } catch(IOException ioe) {
            throw new GroovyRuntimeException(ioe);
        }
    }
View Full Code Here

    public void printIndent() {
        for (int i = 0; i < indentLevel; i++) {
            try {
                out.write(indent);
            } catch(IOException ioe) {
                throw new GroovyRuntimeException(ioe);
            }
        }
    }
View Full Code Here

    public void println() {
        if (addNewlines) {
            try {
                out.write("\n");
            } catch(IOException ioe) {
                throw new GroovyRuntimeException(ioe);
            }
        }
    }
View Full Code Here

    public void flush() {
        try {
            out.flush();
        } catch(IOException ioe) {
            throw new GroovyRuntimeException(ioe);
        }
    }
View Full Code Here

                    }
                    extension = svcIn.readLine();
                }
            }
        } catch (IOException ex) {
          throw new GroovyRuntimeException("IO Exception attempting to load source extension registerers. Exception: " +
              ex.toString() + (service == null ? "" : service.toExternalForm()));
        }
        return extensions;
  }
View Full Code Here

        Script script;
        try {
            script = groovyShell.parse(writer.toString(), "XmlTemplateScript" + counter++ + ".groovy");
        } catch (Exception e) {
            throw new GroovyRuntimeException("Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): " + e.getMessage());
        }
        return new XmlTemplate(script);
    }
View Full Code Here

        assertAsCollection(list, 3);
    }

    public void testInvokerException() throws Throwable {
        try {
            throw new GroovyRuntimeException("message", new NullPointerException());
        }
        catch (GroovyRuntimeException e) {
            // worked
            assertEquals("message", e.getMessage());
            assertTrue(e.getCause() instanceof NullPointerException);
View Full Code Here

TOP

Related Classes of groovy.lang.GroovyRuntimeException

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.