Package org.codehaus.groovy.control.messages

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


    }
    return expressions;
  }

  private void handleMalformedDependency(Expression expression) {
    Message message = createSyntaxErrorMessage(
        "The string must be of the form \"group:module:version\"\n", expression);
    getSourceUnit().getErrorCollector().addErrorAndContinue(message);
  }
View Full Code Here


    this.resolutionContext.setManagedDependencies(ManagedDependencies
        .get(managedDependencies));
  }

  private void handleDuplicateGrabMetadataAnnotation(AnnotationNode annotationNode) {
    Message message = createSyntaxErrorMessage(
        "Duplicate @GrabMetadata annotation. It must be declared at most once.",
        annotationNode);
    getSourceUnit().getErrorCollector().addErrorAndContinue(message);
  }
View Full Code Here

    public boolean failedWithUnexpectedEOF() {
        // Implementation note - there are several ways for the Groovy compiler
        // to report an unexpected EOF. Perhaps this implementation misses some.
        // If you find another way, please add it.
        if (getErrorCollector().hasErrors()) {
            Message last = (Message) getErrorCollector().getLastError();
            Throwable cause = null;
            if (last instanceof SyntaxErrorMessage) {
                cause = ((SyntaxErrorMessage) last).getCause().getCause();
            }
            if (cause != null) {
View Full Code Here

     * underlying SyntaxException, or null if it isn't one.
     */
    public SyntaxException getSyntaxError(int index) {
        SyntaxException exception = null;

        Message message = getError(index);
        if (message != null && message instanceof SyntaxErrorMessage) {
            exception = ((SyntaxErrorMessage) message).getCause();
        }
        return exception;
    }
View Full Code Here

     * underlying Exception, or null if it isn't one.
     */
    public Exception getException(int index) {
        Exception exception = null;

        Message message = getError(index);
        if (message != null) {
            if (message instanceof ExceptionMessage) {
                exception = ((ExceptionMessage) message).getCause();
            }
            else if (message instanceof SyntaxErrorMessage) {
View Full Code Here

    private void write(PrintWriter writer, Janitor janitor, List messages, String txt) {
        if (messages==null || messages.size()==0) return;
        Iterator iterator = messages.iterator();
        while (iterator.hasNext()) {
            Message message = (Message) iterator.next();
            message.write(writer, janitor);
           
            if (configuration.getDebug() && (message instanceof SyntaxErrorMessage)){
                SyntaxErrorMessage sem = (SyntaxErrorMessage) message;
                sem.getCause().printStackTrace(writer);
            }
View Full Code Here

    Script script;
    try {
      script = groovyShell.parse(fullSnippet, snippet.getClassName());
    } catch (MultipleCompilationErrorsException e) {
      Message error = e.getErrorCollector().getError(0);
      if (error instanceof SyntaxErrorMessage) {
        //noinspection ThrowableResultOfMethodCallIgnored
        throw new CompileException(e, ((SyntaxErrorMessage) error).getCause().getLine());
      } else {
        throw e;
View Full Code Here

TOP

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

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.