Examples of Expression


Examples of httl.ast.Expression

                blank ++;
              }
              if (blank > 0) {
                expr = expr.substring(blank);
              }
              Expression expression = (Expression) expressionParser.parse(expr, exprOffset + i + 1 + blank + o);
              boolean export = false;
              boolean hide = false;
              if (var.endsWith(":")) {
                export = true;
                var = var.substring(0, var.length() - 1).trim();
              } else if (var.endsWith(".")) {
                hide = true;
                var = var.substring(0, var.length() - 1).trim();
              }
              int j = var.lastIndexOf(' ');
              String type = null;
              if (j > 0) {
                type = var.substring(0, j).trim();
                var = var.substring(j + 1).trim();
              }
              directives.add(new SetDirective(parseGenericType(type, exprOffset), var, expression, export, hide, offset));
              o += v.length() + 1;
            }
          } else {
            defineVariableTypes(value, offset, directives);
          }
        } else if (StringUtils.inArray(name, forDirective)) {
          if (StringUtils.isNumber(value.trim())) {
            value = "__for" + seq.incrementAndGet() + " : 1 .. " + value.trim();
          }
          int i = value.indexOf(" in ");
          int n = 4;
          if (i < 0) {
            i = value.indexOf(':');
            n = 1;
          }
          if (i < 0) {
            throw new ParseException("Miss colon \":\" in invalid directive #for(" + value + ")", offset);
          }
          String var = value.substring(0, i).trim();
          String expr = value.substring(i + n);
          int blank = 0;
          while (blank < expr.length()) {
            if (! Character.isWhitespace(expr.charAt(blank))) {
              break;
            }
            blank ++;
          }
          if (blank > 0) {
            expr = expr.substring(blank);
          }
          Expression expression = (Expression) expressionParser.parse(expr, exprOffset + i + n + blank);
          int j = var.lastIndexOf(' ');
          String type = null;
          if (j > 0) {
            type = var.substring(0, j).trim();
            var = var.substring(j + 1).trim();
View Full Code Here

Examples of io.crate.sql.tree.Expression

    private SubscriptContext analyzeSubscript(String expressionString) {
        Analyzer.ParameterContext parameterContext = mock(Analyzer.ParameterContext.class);
        when(parameterContext.getAsSymbol(anyInt())).thenReturn(new Parameter(currentParameter));
        SubscriptContext context = new SubscriptContext(parameterContext);
        Expression expression = SqlParser.createExpression(expressionString);
        expression.accept(visitor, context);
        return context;
    }
View Full Code Here

Examples of ivory.smrf.model.builder.Expression

    String[] terms = new String[termNodes.size()];
    for (int i = 0; i < termNodes.size(); i++) {
      terms[i] = termNodes.get(i).getTerm();
    }

    Expression expression = expressionGenerator.getExpression(terms);

    // Get inverted list for this expression.
    postingsReader = env.getPostingsReader(expression);

    // Get collection statistics for the expression.
View Full Code Here

Examples of japa.parser.ast.expr.Expression

            if (fd.getVariables() == null || fd.getVariables().size() != 1) {
                throw new IllegalStateException(
                        "Illegal state: JavaParser did not return a field declaration correctly");
            }

            final Expression init = fd.getVariables().get(0).getInit();

            // Resolve imports (ROO-1505)
            if (init instanceof ObjectCreationExpr) {
                final ObjectCreationExpr ocr = (ObjectCreationExpr) init;
                final JavaType typeToImport = JavaParserUtils.getJavaTypeNow(
View Full Code Here

Examples of jaque.expressions.Expression

    return Expression.invoke((InvocableExpression) e.getMethod()
        .apply(this), Collections.unmodifiableList(newArgs));
  }

  public Expression visit(MemberExpression e) {
    Expression instance = e.getInstance();
    if (instance != null) {
      instance = stripQuotes(instance.apply(this));
      if (instance.getExpressionType() == ExpressionType.Lambda)
        return instance;
      if (instance != e.getInstance())
        return Expression.member(e.getExpressionType(), instance, e
            .getMember(), e.getResultType(), e.getParameters());
    }
View Full Code Here

Examples of java.beans.Expression

                        @SuppressWarnings("unchecked")
                        @Override
                        protected void initialize(Class type,
                                Object oldInstance, Object newInstance,
                                Encoder out) {
                            out.writeExpression(new Expression(object,
                                    oldInstance, "go", new Object[] {}));
                        }
                    });
            AType a = new AType();
View Full Code Here

Examples of javarepl.expressions.Expression

        return context.get(Completer.class).apply(expression);
    }

    public ExpressionTemplate template(String expression) {
        Evaluator evaluator = context.get(Evaluator.class);
        Expression parsedExpression = evaluator.parseExpression(expression).right();

        return new ExpressionTemplate(renderExpressionClass(evaluator.context(), randomIdentifier("Evaluation"), parsedExpression), EXPRESSION_TOKEN);
    }
View Full Code Here

Examples of javax.el.Expression

  private int compare(JavaBeanWrapper w1, JavaBeanWrapper w2) {
    int result = 0;
   
    for (Iterator<SortField2> iterator = sortFields.iterator(); iterator.hasNext() && result == 0;) {
      SortField2 field = iterator.next();
      Expression expression = field.getExpression();
      String prop = expression.getExpressionString();
      Ordering ordering = field.getOrdering();
      if (ordering != null) {
        Object p1 = w1.getProperty(prop);
        Object p2 = w2.getProperty(prop);
        if (p1 == p2 && p1 instanceof Comparator) {
View Full Code Here

Examples of javax.persistence.criteria.Expression

              // converting to the column(s) associated with the entity's ID in the rendered SQL.  However, some DBs don't support
              // the multiple columns that would end up here for entities with composite IDs.  So, since we modify the query to
              // instead specify star since that's functionally equivalent and supported by all DBs.
          List<Expression<?>> argExprs = getArgumentExpressions();
          if (argExprs.size() == 1) {
                  Expression argExpr = argExprs.get(0);
                  if (argExpr instanceof Root<?>) {
                      Root<?> root = (Root<?>)argExpr;
                      if (root.getModel().getIdType() != null) {
                          buffer.append('*');
                          return;
View Full Code Here

Examples of javax.servlet.jsp.el.Expression

      try {
        if (value instanceof String) {
          Class type = PropertyUtils.getPropertyDescriptor(object.getClass(), name).getPropertyType();
          if (type == Expression.class) {
            String s = "${" + value + "}";
            Expression e = evaluator.parseExpression(s, Object.class, this);
            PropertyUtils.setProperty(object, name, new PrintableExpression(e, (String) value));
          } else {           
            PropertyUtils.setPropertyFromString(object, name, (String)value);
          }
        } else {
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.