Examples of SyntaxException


Examples of org.codehaus.groovy.syntax.SyntaxException

            if (propertyNode.getName().equals(fieldName)) {
                if (field.isStatic()) {
                    //noinspection ThrowableInstanceNeverThrown
                    source.getErrorCollector().addErrorAndContinue(
                                new SyntaxErrorMessage(new SyntaxException(
                                    "@groovy.beans.Vetoable cannot annotate a static property.",
                                    node.getLineNumber(),
                                    node.getColumnNumber()),
                                    source));
                } else {
                    createListenerSetter(source, node, bindable, declaringClass,  propertyNode);
                }
                return;
            }
        }
        //noinspection ThrowableInstanceNeverThrown
        source.getErrorCollector().addErrorAndContinue(
                    new SyntaxErrorMessage(new SyntaxException(
                        "@groovy.beans.Vetoable must be on a property, not a field.  Try removing the private, protected, or public modifier.",
                        node.getLineNumber(),
                        node.getColumnNumber()),
                        source));
    }
View Full Code Here

Examples of org.codehaus.groovy.syntax.SyntaxException

    public void addError(String msg, ASTNode expr) {
        int line = expr.getLineNumber();
        int col = expr.getColumnNumber();
        SourceUnit source = sourceUnit();
        source.getErrorCollector().addErrorAndContinue(
                new SyntaxErrorMessage(new SyntaxException(msg + '\n', line, col), source)
        );
    }
View Full Code Here

Examples of org.codehaus.groovy.syntax.SyntaxException

public abstract class ImplicitAssertionsTransformationUtil {

  public static void  reportError(ASTNode node, String message, SourceUnit sourceUnit) {
    int line = node.getLineNumber() > 0 ? node.getLineNumber() : node.getLastLineNumber();
    int column = node.getColumnNumber() > 0 ? node.getColumnNumber() : node.getLastColumnNumber();
    SyntaxErrorMessage errorMessage = new SyntaxErrorMessage(new SyntaxException(message, line, column), sourceUnit);
    sourceUnit.getErrorCollector().addErrorAndContinue(errorMessage);
  }
View Full Code Here

Examples of org.codehaus.groovy.syntax.SyntaxException

     * @param sourceUnit The SourceUnit
     * @param node The node that was annotated
     * @param msg The error message to display
     */
    private void generateSyntaxErrorMessage(SourceUnit sourceUnit, AnnotationNode node, String msg) {
        SyntaxException error = new SyntaxException(msg, node.getLineNumber(), node.getColumnNumber());
        sourceUnit.getErrorCollector().addErrorAndContinue(new SyntaxErrorMessage(error, sourceUnit));
    }
View Full Code Here

Examples of org.codehaus.groovy.syntax.SyntaxException

        } else {
            error = true;
        }
        if (pMessage instanceof SyntaxErrorMessage) {
            SyntaxErrorMessage syntaxErrorMessage = (SyntaxErrorMessage)pMessage;
            SyntaxException syntaxException = syntaxErrorMessage.getCause();
            message = syntaxException.getMessage();
            fileName = syntaxException.getSourceLocator();
            // FIXME: getStartLine() vs. getLine()
            startLine = syntaxException.getStartLine();
            startColumn = syntaxException.getStartColumn();
            endLine = syntaxException.getLine();
            endColumn = syntaxException.getEndColumn();
        } else {
            fileName = "";
            startLine = 0;
            startColumn = 0;
            endLine = 0;
View Full Code Here

Examples of org.codehaus.groovy.syntax.SyntaxException

        this.annotation.setAllowedTargets(bitmap);
    }

    protected void addError(String msg) {
        this.errorCollector.addErrorAndContinue(
          new SyntaxErrorMessage(new SyntaxException(msg
                  + " in @" + this.annotationClass.getName() + '\n',
                  this.annotation.getLineNumber(),
                  this.annotation.getColumnNumber()), this.source)
        );
    }
View Full Code Here

Examples of org.codehaus.groovy.syntax.SyntaxException

        );
    }

    protected void addError(String msg, ASTNode expr) {
        this.errorCollector.addErrorAndContinue(
          new SyntaxErrorMessage(new SyntaxException(msg
                  + " in @" + this.annotationClass.getName() + '\n',
                  expr.getLineNumber(),
                  expr.getColumnNumber()), this.source)
        );
    }
View Full Code Here

Examples of org.codehaus.groovy.syntax.SyntaxException

         */
        private void addError(String msg, ASTNode expr) {
            int line = expr.getLineNumber();
            int col = expr.getColumnNumber();
            sourceUnit.getErrorCollector().addErrorAndContinue(
                    new SyntaxErrorMessage(new SyntaxException(msg + '\n', line, col), sourceUnit)
            );
        }
View Full Code Here

Examples of org.codehaus.groovy.syntax.SyntaxException

                    Expression exp = (Expression) oldArgsIterator.next();
                    if (exp instanceof MapEntryExpression) {
                        String msg = "The usage of a map entry expression to initialize an Enum is currently not supported, please use an explicit map instead.";
                        sourceUnit.getErrorCollector().addErrorAndContinue(
                                new SyntaxErrorMessage(
                                        new SyntaxException(msg + '\n', exp.getLineNumber(), exp.getColumnNumber()), sourceUnit)
                        );
                        continue;
                    }
                   
                    InnerClassNode inner = null;
View Full Code Here

Examples of org.codehaus.groovy.syntax.SyntaxException

    protected void addError(String msg, ASTNode expr) {
        int line = expr.getLineNumber();
        int col = expr.getColumnNumber();
        sourceUnit.getErrorCollector().addErrorAndContinue(
                new SyntaxErrorMessage(new SyntaxException(msg + '\n', line, col), sourceUnit)
        );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.