Examples of InvalidExpressionException


Examples of com.intellij.execution.filters.InvalidExpressionException

  private final int myColumnMatchGroup;

  public FileReferenceFilter(@NotNull Project project, @NonNls @NotNull String expression) {
    myProject = project;
    if (StringUtil.isEmpty(expression)) {
      throw new InvalidExpressionException("expression is empty");
    }
    int filePathIndex = expression.indexOf(PATH_MACROS);
    int lineIndex = expression.indexOf(LINE_MACROS);
    int columnIndex = expression.indexOf(COLUMN_MACROS);

    if (filePathIndex == -1) {
      throw new InvalidExpressionException("Expression must contain " + PATH_MACROS + " macros.");
    }
    TreeMap<Integer,String> map = new TreeMap<Integer, String>();
    map.put(filePathIndex, PATH_MACROS);
    expression = StringUtil.replace(expression, PATH_MACROS, FILE_PATH_REGEXP);
View Full Code Here

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

Examples of org.auraframework.throwable.quickfix.InvalidExpressionException

    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

Examples of org.auraframework.throwable.quickfix.InvalidExpressionException

     */
    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

Examples of org.auraframework.throwable.quickfix.InvalidExpressionException

                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

Examples of org.auraframework.throwable.quickfix.InvalidExpressionException

    }

    @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

Examples of org.auraframework.throwable.quickfix.InvalidExpressionException

    }

    @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

Examples of org.auraframework.throwable.quickfix.InvalidExpressionException

    }

    @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

Examples of org.auraframework.throwable.quickfix.InvalidExpressionException

        } 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

Examples of org.jboss.errai.codegen.exception.InvalidExpressionException

  }

  @Override
  public void assertCanBeApplied(MetaClass clazz) {
    if (!canBeApplied(clazz)) {
      throw new InvalidExpressionException("Not a valid type for operator '" +
          canonicalString + "': " + clazz.getFullyQualifiedName());
    }
  }
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.