Package org.auraframework.throwable.quickfix

Examples of org.auraframework.throwable.quickfix.InvalidExpressionException


    public void parseValue(TypeDef typeDef) throws QuickFixException {
        if (!(this.value instanceof Expression)) {
            try {
                this.parsedValue = typeDef.valueOf(this.value);
            } catch (Throwable t) {
                throw new InvalidExpressionException(t.getMessage(), getLocation(), t);
            }
        }
    }
View Full Code Here


    private void maybeAddPlainText(int begin, int end) throws AuraValidationException {
        String substring = text.substring(begin, end);

        Matcher unterminated = UNTERMINATED_EXPRESSION_PATTERN.matcher(substring);
        if (unterminated.matches()) {
            throw new InvalidExpressionException("Unterminated expression", location);
        }

        Matcher curlyBangInversion = CURLY_BANG_INVERSION_PATTERN.matcher(substring);
        if (curlyBangInversion.matches()) {
            throw new InvalidExpressionException("Found an expression starting with '!{' but it should be '{!'",
                    location);
        }

        Token token = new Token(TokenType.PLAINTEXT, begin, end);
    tokens.add(token);
View Full Code Here

     */
    public Object asValue(ExpressionContainerHandler cmpHandler) throws AuraValidationException {
        if (tokens.isEmpty()) {
            return null;
        } else if (size() > 1) {
            throw new InvalidExpressionException(
                    "Cannot mix expression and literal string in attribute value, try rewriting like {!'foo' + v.bar}",
                    location);
        }
        return tokens.get(0).createValue(cmpHandler);
    }
View Full Code Here

                AuraContext lc = Aura.getContextService().getCurrentContext();
                GlobalValueProvider gvp = lc.getGlobalProviders().get(vpt);
                if (gvp != null) {
                    PropertyReference stem = e.getStem();
                    if (stem == null) {
                        throw new InvalidExpressionException("Expression didn't have enough terms: " + e, e.getLocation());
                    }
                    gvp.validate(stem);
                }
            } else if (vpt == ValueProviderType.VIEW) {
                if (e.getStem() != null) { // checks for private attributes used in expressions ..
View Full Code Here

    }

    @Override
    public void validate(PropertyReference expr) throws InvalidExpressionException {
        if (expr.size() != 1 || !getData().containsKey(expr.getRoot())) {
            throw new InvalidExpressionException("No property on $Browser for key: " + expr, expr.getLocation());
        }
    }
View Full Code Here

    }

    @Override
    public void validate(PropertyReference expr) throws InvalidExpressionException {
        if (expr.size() != 1 || !getData().containsKey(expr.getRoot())) {
            throw new InvalidExpressionException("No property on $Locale for key: " + expr, expr.getLocation());
        }
    }
View Full Code Here

    }

    @Override
    public void validate(PropertyReference expr) throws InvalidExpressionException {
        if (expr.size() != 2) {
            throw new InvalidExpressionException("Labels should have a section and a name: " + expr, expr.getLocation());
        }
        List<String> parts = expr.getList();
        String section = parts.get(0);
        String param = parts.get(1);
        if (!Aura.getLocalizationAdapter().labelExists(section, param)) {
            throw new InvalidExpressionException("No label found for " + expr, expr.getLocation());
        }
    }
View Full Code Here

        } else {
            errorMsg.append(" at column ").append(re.charPositionInLine + 1);
        }
        errorMsg.append(" of expression: ");
        errorMsg.append(exp);
        return new InvalidExpressionException(errorMsg.toString(), l);
    }
View Full Code Here

TOP

Related Classes of org.auraframework.throwable.quickfix.InvalidExpressionException

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.