Examples of SyntaxException


Examples of org.apache.cassandra.exceptions.SyntaxException

    {
        Object val = properties.get(name);
        if (val == null)
            return null;
        if (!(val instanceof String))
            throw new SyntaxException(String.format("Invalid value for property '%s'", name));
        return (String)val;
    }
View Full Code Here

Examples of org.apache.cassandra.exceptions.SyntaxException

    {
        Object val = properties.get(name);
        if (val == null)
            return null;
        if (!(val instanceof Map))
            throw new SyntaxException(String.format("Invalid value for property '%s'", name));
        return (Map<String, String>)val;
    }
View Full Code Here

Examples of org.apache.cassandra.exceptions.SyntaxException

            {
                return Double.valueOf(value);
            }
            catch (NumberFormatException e)
            {
                throw new SyntaxException(String.format("Invalid double value %s for '%s'", value, key));
            }
        }
    }
View Full Code Here

Examples of org.apache.cassandra.exceptions.SyntaxException

            {
                return Integer.valueOf(value);
            }
            catch (NumberFormatException e)
            {
                throw new SyntaxException(String.format("Invalid integer value %s for '%s'", value, key));
            }
        }
    }
View Full Code Here

Examples of org.apache.james.managesieve.api.SyntaxException

     */
    public List<String> parse(String content) throws SyntaxException {
        try {
            _sieveFactory.parse(new ByteArrayInputStream(content.getBytes()));
        } catch (ParseException ex) {
            throw new SyntaxException(ex);
        }
        return EMPTY_WARNINGS;
    }
View Full Code Here

Examples of org.apache.jsieve.exception.SyntaxException

                log.warn(message);
            }
            logDiagnosticsInfo(log);
        }
        final String fullMessage = addStartLineAndColumn(message);
        final SyntaxException result = new SyntaxException(fullMessage);
        return result;
    }
View Full Code Here

Examples of org.codehaus.groovy.syntax.SyntaxException

        String scriptName = source.getClassName();
        GroovyCodeSource codeSource = new GroovyCodeSource(scriptText == null ? "" : scriptText, scriptName, "/groovy/script");
        try {
            groovyClassLoader.parseClass(codeSource, false);
        } catch (MultipleCompilationErrorsException e) {
            SyntaxException syntaxError = e.getErrorCollector().getSyntaxError(0);
            Integer lineNumber = syntaxError == null ? null : syntaxError.getLine();
            throw new ScriptCompilationException(String.format("Could not compile %s.", source.getDisplayName()), e, source,
                    lineNumber);
        } catch (CompilationFailedException e) {
            throw new GradleException(String.format("Could not compile %s.", source.getDisplayName()), e);
        }
View Full Code Here

Examples of org.codehaus.groovy.syntax.SyntaxException

        ClassNode declaringClass = parent.getDeclaringClass();
        if (parent instanceof FieldNode) {
            if ((((FieldNode)parent).getModifiers() & Opcodes.ACC_FINAL) != 0) {
                source.getErrorCollector().addErrorAndContinue(
                            new SyntaxErrorMessage(new SyntaxException(
                                "@groovy.beans.Bindable cannot annotate a final property.",
                                node.getLineNumber(),
                                node.getColumnNumber()),
                                source));
            }
View Full Code Here

Examples of org.codehaus.groovy.syntax.SyntaxException

        for (PropertyNode propertyNode : declaringClass.getProperties()) {
            if (propertyNode.getName().equals(fieldName)) {
                if (field.isStatic()) {
                    //noinspection ThrowableInstanceNeverThrown
                    source.getErrorCollector().addErrorAndContinue(
                                new SyntaxErrorMessage(new SyntaxException(
                                    "@groovy.beans.Bindable cannot annotate a static property.",
                                    node.getLineNumber(),
                                    node.getColumnNumber()),
                                    source));
                } else {
                    if (needsPropertyChangeSupport(declaringClass, source)) {
                        addPropertyChangeSupport(declaringClass);
                    }
                    createListenerSetter(source, node, declaringClass, propertyNode);
                }
                return;
            }
        }
        //noinspection ThrowableInstanceNeverThrown
        source.getErrorCollector().addErrorAndContinue(
                new SyntaxErrorMessage(new SyntaxException(
                        "@groovy.beans.Bindable 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

        if (nodes[1] instanceof ClassNode) {
            addListenerToClass(source, node, (ClassNode) nodes[1]);
        } else {
            if ((((FieldNode)nodes[1]).getModifiers() & Opcodes.ACC_FINAL) != 0) {
                source.getErrorCollector().addErrorAndContinue(
                            new SyntaxErrorMessage(new SyntaxException(
                                "@groovy.beans.Vetoable cannot annotate a final property.",
                                node.getLineNumber(),
                                node.getColumnNumber()),
                                source));
            }
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.