Package javax.jcr.query.qom

Examples of javax.jcr.query.qom.StaticOperand


     * @throws RepositoryException if the operand can't be evaluated
     */
    public Value[] getValues(Operand operand, Node node)
            throws RepositoryException {
        if (operand instanceof StaticOperand) {
            StaticOperand so = (StaticOperand) operand;
            return new Value[] { getValue(so) };
        }
        if (operand instanceof FullTextSearchScore) {
            final double defaultScore = 0.0;
            return new Value[] { factory.createValue(defaultScore) };
View Full Code Here


        }
        QueryParser parser = new JackrabbitQueryParser(
                fieldname, index.getTextAnalyzer(),
                index.getSynonymProvider(), cache);
        try {
            StaticOperand expr = fts.getFullTextSearchExpression();
            return parser.parse(evaluator.getValue(expr).getString());
        } catch (ParseException e) {
            throw new RepositoryException(e);
        }
    }
View Full Code Here

        } else if (constraint instanceof Comparison) {
            Comparison c = (Comparison) constraint;
            Transform transform = new Transform(c.getOperand1());
            DynamicOperand left = transform.operand;
            final String operator = c.getOperator();
            StaticOperand right = c.getOperand2();
            if (left instanceof Length
                    || left instanceof FullTextSearchScore
                    || (((!JCR_OPERATOR_EQUAL_TO.equals(operator) && !JCR_OPERATOR_LIKE
                            .equals(operator)) || transform.transform != TRANSFORM_NONE) && (left instanceof NodeName || left instanceof NodeLocalName))) {
                try {
View Full Code Here

            Name name = session.getQName(property);
            field = nsMappings.getPrefix(name.getNamespaceURI()) + ":"
                + FieldNames.FULLTEXT_PREFIX + name.getLocalName();
        }

        StaticOperand expression = fts.getFullTextSearchExpression();
        String query = evaluator.getValue(expression).getString();
        try {
            QueryParser parser = new JackrabbitQueryParser(
                    field, index.getTextAnalyzer(),
                    index.getSynonymProvider(), cache);
View Full Code Here

        } else if (readIf("FALSE")) {
            Literal literal = getUncastLiteral(valueFactory.createValue(false));
            return literal;
        } else if (readIf("CAST")) {
            read("(");
            StaticOperand op = parseStaticOperand();
            if (!(op instanceof Literal)) {
                throw getSyntaxError("literal");
            }
            Literal literal = (Literal) op;
            Value value = literal.getLiteralValue();
View Full Code Here

        } else if (readIf("FALSE")) {
            Literal literal = factory.literal(valueFactory.createValue(false));
            return literal;
        } else if (readIf("CAST")) {
            read("(");
            StaticOperand op = parseStaticOperand();
            if (!(op instanceof Literal)) {
                throw getSyntaxError("literal");
            }
            Literal literal = (Literal) op;
            Value value = literal.getLiteralValue();
View Full Code Here

            fieldname = tmp.toString();
        }
        QueryParser parser = new JackrabbitQueryParser(
                fieldname, analyzer, synonymProvider);
        try {
            StaticOperand expr = fts.getFullTextSearchExpression();
            if (expr instanceof Literal) {
                return parser.parse(
                        ((Literal) expr).getLiteralValue().getString());
            } else {
                throw new RepositoryException(
View Full Code Here

        } else if (readIf("FALSE")) {
            Literal literal = factory.literal(valueFactory.createValue(false));
            return literal;
        } else if (readIf("CAST")) {
            read("(");
            StaticOperand op = parseStaticOperand();
            if (!(op instanceof Literal)) {
                throw getSyntaxError("literal");
            }
            Literal literal = (Literal) op;
            Value value = literal.getLiteralValue();
View Full Code Here

        } else if (readIf("FALSE")) {
            Literal literal = getUncastLiteral(valueFactory.createValue(false));
            return literal;
        } else if (readIf("CAST")) {
            read("(");
            StaticOperand op = parseStaticOperand();
            if (!(op instanceof Literal)) {
                throw getSyntaxError("literal");
            }
            Literal literal = (Literal) op;
            Value value = literal.getLiteralValue();
View Full Code Here

        }
        QueryParser parser = new JackrabbitQueryParser(
                fieldname, index.getTextAnalyzer(),
                index.getSynonymProvider(), cache);
        try {
            StaticOperand expr = fts.getFullTextSearchExpression();
            return parser.parse(evaluator.getValue(expr).getString());
        } catch (ParseException e) {
            throw new RepositoryException(e);
        }
    }
View Full Code Here

TOP

Related Classes of javax.jcr.query.qom.StaticOperand

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.