Examples of Expression


Examples of org.apache.cayenne.exp.Expression

            jointRoot = jointRoot.getParent();
        }

        String prefix;
        if (jointRoot != this) {
            Expression objectPath = Expression.fromString(getPath(jointRoot));
            ASTPath translated = (ASTPath) ((PrefetchProcessorNode) jointRoot)
                    .getResolver()
                    .getEntity()
                    .translateToDbPath(objectPath);
View Full Code Here

Examples of org.apache.clerezza.rdf.core.sparql.query.Expression

        ClerezzaSparqlObject argument1 = (ClerezzaSparqlObject) adapter.adaptTo(numericFunctionAtom1,
            ConstructQuery.class);
        ClerezzaSparqlObject argument2 = (ClerezzaSparqlObject) adapter.adaptTo(numericFunctionAtom2,
            ConstructQuery.class);

        Expression lhsOperand = (Expression) argument1.getClerezzaObject();
        Expression rhsOperand = (Expression) argument2.getClerezzaObject();

        BinaryOperation binaryOperation = new BinaryOperation("+", lhsOperand, rhsOperand);

        return (T) new ClerezzaSparqlObject(binaryOperation);
View Full Code Here

Examples of org.apache.cocoon.el.Expression

    }
   
    private Token processNewExpression(Token expr, ExpressionFactory expressionFactory, ObjectModel newObjectModel) throws PatternException {
        Object result;
        try {
            Expression newExpression = expressionFactory.getExpression(expr.getStringValue());
            result = newExpression.evaluate(newObjectModel);
        } catch (ExpressionException e) {
            throw new PatternException("Cannot evaluate new expression '" + expr.getStringValue() + "' in expression "
                                       + "'" + this.originalExpr + "'", e);
        }
        return new Token(EXPR, result == null ? "" : result.toString());
View Full Code Here

Examples of org.apache.commons.betwixt.expression.Expression

                            }
                                                       
                        } else {
                            // use id from bean property
                            // it's up to the user to ensure uniqueness
                            Expression idExpression = idAttribute.getTextExpression();
                            if(idExpression == null) {
                                   throw new IntrospectionException(
                                         "The specified id property wasn't found in the bean ("
                                        + idAttribute + ").");
                            }
                            Object exp = idExpression.evaluate( context );
                            if (exp == null) {
                                // we'll use a random id
                                log.debug("Using random id");
                                id = idGenerator.nextId();
                               
View Full Code Here

Examples of org.apache.commons.el.Expression

            }
        }

        // Resolve the last suffix
        ArraySuffix arraySuffix = (ArraySuffix) suffixes.get(max);
        Expression arraySuffixIndex = arraySuffix.getIndex();

        Object index;
        if (arraySuffixIndex != null)
        {
            index = arraySuffixIndex.evaluate(
                    variableResolver, s_functionMapper,
                    ELParserHelper.LOGGER);
            if (index == null)
            {
                throw new PropertyNotFoundException("Index is null: "
                    + arraySuffixIndex.getExpressionString());
            }
        }
        else
        {
            index = ((PropertySuffix) arraySuffix).getName();
View Full Code Here

Examples of org.apache.commons.jelly.expression.Expression

                        // this is O(N) operation, but we don't expect there to be a lot of collisions.
                        int idx = actual.getIndex(name);
                        if(idx>=0actual.removeAttribute(idx);
                    }

                    Expression expression = e.getValue().exp;
                    actual.addAttribute("",name,name,"CDATA",expression.evaluateAsString(context));
                }

                try {
                    output.startElement(tagName,actual);
                    getTagBody().run(context,output);
View Full Code Here

Examples of org.apache.commons.jexl.Expression

    {
      try
      {
        CallflowNotification notif = (CallflowNotification) notification;
        JexlContext jc = JexlHelper.createContext();
        Expression msgExpression = null;
        msgExpression = ExpressionFactory.createExpression("log." + _filter);

        jc.getVars().put("log", notif.getMessageInfo());
        jc.getVars().put("message", notif.getMessageInfo().getMessage());

        return ((Boolean) msgExpression.evaluate(jc));
      }
      catch (Exception e)
      {
        Log.ignore(e);
      }
View Full Code Here

Examples of org.apache.commons.jexl2.Expression

    public String evaluate(final String expression, final JexlContext jexlContext) {
        String result = "";

        if (StringUtils.isNotBlank(expression) && jexlContext != null) {
            try {
                Expression jexlExpression = jexlEngine.createExpression(expression);
                Object evaluated = jexlExpression.evaluate(jexlContext);
                if (evaluated != null) {
                    result = evaluated.toString();
                }
            } catch (JexlException e) {
                LOG.error("Invalid jexl expression: " + expression, e);
View Full Code Here

Examples of org.apache.commons.jxpath.ri.compiler.Expression

    protected CompiledExpression compilePath(String xpath) {
        return new JXPathCompiledExpression(xpath, compileExpression(xpath));
    }

    private Expression compileExpression(String xpath) {
        Expression expr;
        if (USE_SOFT_CACHE) {
            expr = null;
            SoftReference ref = (SoftReference) compiled.get(xpath);
            if (ref != null) {
                expr = (Expression) ref.get();
View Full Code Here

Examples of org.apache.felix.gogo.runtime.Expression

        variables.put("c", 1l);
        variables.put("d", 2l);
        variables.put("s", " foo ");
        variables.put("t", "bar");

        assertEquals(4l, new Expression("c+=1, d+=2").eval(variables));

        assertEquals(" foo ", new Expression("\" foo \"").eval());
        assertEquals(" foo bar", new Expression("s + t").eval(variables));
        assertEquals(1l, new Expression("s < t").eval(variables));
        assertEquals(1l, new Expression("s > t || t == \"bar\"").eval(variables));

        assertEquals(3l, new Expression("a += 1").eval(variables));
        assertEquals(3l, variables.get("a"));

        assertEquals(30l, new Expression("10 + 20 | 30").eval());

        assertEquals(8l, new Expression("a + b").eval(variables));
        assertEquals(3l, new Expression("if(a < b, a, b)").eval(variables));

        assertEquals(16l, new Expression("2 + 2 << 2").eval());
        assertEquals(8l, new Expression("2 | 2 << 2").eval());
    }
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.