Examples of BindVariableName


Examples of org.modeshape.jcr.query.model.BindVariableName

            }
            tokens.consume(',');

            if (tokens.canConsume('$')) {
                // The value parameter is a bind variable ...
                BindVariableName var = parseBindVariableName(tokens, typeSystem);
                try {
                    constraint = fullTextSearch(selectorName, propertyName, var);
                } catch (RepositoryException e) {
                    String msg = GraphI18n.functionHasInvalidBindVariable.text("CONTAINS()", pos.getLine(), pos.getColumn(), var);
                    throw new ParsingException(pos, msg);
View Full Code Here

Examples of org.modeshape.jcr.query.model.BindVariableName

                                             String propertyName ) {
        return new ReferenceValue(selector, propertyName);
    }

    protected BindVariableName bindVariableName( String variableName ) {
        return new BindVariableName(variableName);
    }
View Full Code Here

Examples of org.modeshape.jcr.query.model.BindVariableName

                                          QueryContext context,
                                          TypeFactory<?> type ) {
        // Determine the literal value ...
        Object literalValue = null;
        if (staticOperand instanceof BindVariableName) {
            BindVariableName bindVariable = (BindVariableName)staticOperand;
            String variableName = bindVariable.getBindVariableName();
            literalValue = context.getVariables().get(variableName); // may be null
            if (LOGGER.isTraceEnabled()) {
                LOGGER.trace("Using variable '{0}' value: {1}", variableName, literalValue);
            }
            if (literalValue instanceof Collection || literalValue instanceof Object[]) return literalValue;
View Full Code Here

Examples of org.modeshape.jcr.query.model.BindVariableName

                               StaticOperand operand ) {
        if (operand instanceof Literal) {
            Literal literal = (Literal)operand;
            return literal.value();
        }
        BindVariableName variable = (BindVariableName)operand;
        return context.getVariables().get(variable.getBindVariableName());
    }
View Full Code Here

Examples of org.modeshape.jcr.query.model.BindVariableName

    protected static String stringValue( StaticOperand operand,
                                         QueryContext context ) {
        // This is a constraint on the ID of a node ...
        Object value = null;
        if (operand instanceof BindVariableName) {
            BindVariableName varName = (BindVariableName)operand;
            value = context.getVariables().get(varName.getBindVariableName());
        } else if (operand instanceof Literal) {
            value = ((Literal)operand).value();
        }
        if (value != null && value instanceof String) {
            return (String)value;
View Full Code Here

Examples of org.modeshape.jcr.query.model.BindVariableName

         * @param variableName the name of the variable
         * @return the constraint builder; never null
         */
        public ConstraintBuilder variable( String variableName ) {
            return comparisonBuilder.constraintBuilder.setConstraint(new Between(comparisonBuilder.left, lowerBound,
                                                                                 new BindVariableName(variableName)));
        }
View Full Code Here

Examples of org.modeshape.jcr.query.model.BindVariableName

            }
            variableName = variableName + i;
            subqueriesByVariableName.put(variableName, subquery);
            context.getVariables().put(variableName, null);
            // Replace with a variable substitution ...
            return new BindVariableName(variableName);
        }
        return staticOperand;
    }
View Full Code Here

Examples of org.modeshape.jcr.query.model.BindVariableName

         *         complete already-started clauses; never null
         */
        public ConstraintBuilder isVariable( Operator operator,
                                             String variableName ) {
            CheckArg.isNotNull(operator, "operator");
            return this.constraintBuilder.setConstraint(new Comparison(left, operator, new BindVariableName(variableName)));
        }
View Full Code Here

Examples of org.modeshape.jcr.query.model.BindVariableName

        private void addValues( StaticOperand valueOperand,
                                Set<String> matchedKeys ) {
            if (valueOperand instanceof BindVariableName) {
                // We have to resolve the variable ...
                BindVariableName varName = (BindVariableName)valueOperand;
                String varNameStr = varName.getBindVariableName();
                Object varValue = this.variables.get(varNameStr);
                if (varValue instanceof Collection) {
                    Collection<?> collection = (Collection<?>)varValue;
                    for (Object value : collection) {
                        StaticOperand operand = new Literal(value);
View Full Code Here

Examples of org.modeshape.jcr.query.model.BindVariableName

         *
         * @param variableName the name of the variable
         * @return the constraint builder; never null
         */
        public AndBuilder<UpperBoundary> variable( String variableName ) {
            return new AndBuilder<UpperBoundary>(new UpperBoundary(comparisonBuilder, new BindVariableName(variableName)));
        }
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.