Examples of LiteralExpression


Examples of org.apache.camel.language.simple.ast.LiteralExpression

            }

            // if no token was created then its a character/whitespace/escaped symbol
            // which we need to add together in the same image
            if (imageToken == null) {
                imageToken = new LiteralExpression(token);
            }
            imageToken.addText(token.getText());
        }

        // append any leftover image tokens (when we reached eol)
View Full Code Here

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

    SimpleBasicGraphPattern bgp = new SimpleBasicGraphPattern(triplePatterns);
    SimpleGroupGraphPattern queryPattern = new SimpleGroupGraphPattern();
    queryPattern.addGraphPattern(bgp);
    BinaryOperation constraint = new BinaryOperation("<",
        price, new LiteralExpression(LiteralFactory.getInstance().createTypedLiteral(30.5)));
    queryPattern.addConstraint(constraint);
    selectQuery.setQueryPattern(queryPattern);

    Assert.assertTrue(selectQuery.toString()
        .replaceAll("( |\n)+", " ").trim().equals(queryString));
View Full Code Here

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

    SimpleGroupGraphPattern queryPattern = new SimpleGroupGraphPattern();
    queryPattern.addGraphPattern(bgp);

    List<Expression> arguments = new ArrayList<Expression>();
    arguments.add(x);
    arguments.add(new LiteralExpression(LiteralFactory.getInstance().
        createTypedLiteral(".*uni.*")));
    BuiltInCall constraint = new BuiltInCall("REGEX", arguments);
    queryPattern.addConstraint(constraint);
    selectQuery.setQueryPattern(queryPattern);
    Assert.assertTrue(selectQuery.toString()
View Full Code Here

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

        }

        if (number.startsWith(Symbols.variablesPrefix)) {
            exp = new Variable(number.replace(Symbols.variablesPrefix, ""));
        } else {
            exp = new LiteralExpression(LiteralFactory.getInstance().createTypedLiteral(number));
        }

        return (T) new ClerezzaSparqlObject(exp);
    }
View Full Code Here

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

        }

        if (string.startsWith(Symbols.variablesPrefix)) {
            exp = new Variable(string.replace(Symbols.variablesPrefix, ""));
        } else {
            exp = new LiteralExpression(new PlainLiteralImpl(string));
        }

        return (T) new ClerezzaSparqlObject(exp);
    }
View Full Code Here

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

            literal = LiteralFactory.getInstance().createTypedLiteral(number);
        } else {
            throw new org.apache.stanbol.rules.base.api.RuleAtomCallExeption(getClass());
        }

        LiteralExpression literalExpression = new LiteralExpression(literal);

        return (T) new ClerezzaSparqlObject(literalExpression);

    }
View Full Code Here

Examples of org.apache.olingo.odata2.api.uri.expression.LiteralExpression

      }
      return memberType.valueToString(getPropertyValue(data, propertyPath), EdmLiteralKind.DEFAULT, memberProperty
          .getFacets());

    case LITERAL:
      final LiteralExpression literal = (LiteralExpression) expression;
      final EdmSimpleType literalType = (EdmSimpleType) literal.getEdmType();
      return literalType.valueToString(literalType.valueOfString(literal.getUriLiteral(), EdmLiteralKind.URI, null,
          literalType.getDefaultType()),
          EdmLiteralKind.DEFAULT, null);

    case METHOD:
      final MethodExpression methodExpression = (MethodExpression) expression;
View Full Code Here

Examples of org.apache.olingo.odata2.api.uri.expression.LiteralExpression

      }
      return memberType.valueToString(getPropertyValue(data, propertyPath), EdmLiteralKind.DEFAULT, memberProperty
          .getFacets());

    case LITERAL:
      final LiteralExpression literal = (LiteralExpression) expression;
      final EdmSimpleType literalType = (EdmSimpleType) literal.getEdmType();
      return literalType.valueToString(literalType.valueOfString(literal.getUriLiteral(), EdmLiteralKind.URI, null,
          literalType.getDefaultType()),
          EdmLiteralKind.DEFAULT, null);

    case METHOD:
      final MethodExpression methodExpression = (MethodExpression) expression;
View Full Code Here

Examples of org.apache.phoenix.expression.LiteralExpression

    @Override
    public Expression visitLeave(DivideParseNode node, List<Expression> children) throws SQLException {
        for (int i = 1; i < children.size(); i++) { // Compile time check for divide by zero and null
            Expression child = children.get(i);
                if (child.getDataType() != null && child instanceof LiteralExpression) {
                    LiteralExpression literal = (LiteralExpression)child;
                    if (literal.getDataType() == PDataType.DECIMAL) {
                        if (PDataType.DECIMAL.compareTo(literal.getValue(), BigDecimal.ZERO) == 0) {
                            throw new SQLExceptionInfo.Builder(SQLExceptionCode.DIVIDE_BY_ZERO).build().buildException();
                        }
                    } else {
                        if (literal.getDataType().compareTo(literal.getValue(), 0L, PDataType.LONG) == 0) {
                            throw new SQLExceptionInfo.Builder(SQLExceptionCode.DIVIDE_BY_ZERO).build().buildException();
                        }
                    }
                }
        }
View Full Code Here

Examples of org.apache.phoenix.expression.LiteralExpression

    // Addition
    // result scale should be: max(ls, rs)
    // result precision should be: max(lp - ls, rp - rs) + 1 + max(ls, rs)
    @Test
    public void testDecimalAddition() throws Exception {
        LiteralExpression op1, op2, op3;
        List<Expression> children;
        ImmutableBytesWritable ptr;
        DecimalAddExpression e;
        boolean evaluated;
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.