Package org.jboss.dna.graph.query.model

Examples of org.jboss.dna.graph.query.model.Literal


         *
         * @param literal the literal value;
         * @return the constraint builder; never null
         */
        public AndBuilder<UpperBoundary> literal( UUID literal ) {
            return new AndBuilder<UpperBoundary>(new UpperBoundary(comparisonBuilder, new Literal(literal)));
        }
View Full Code Here


         *
         * @param literal the literal value;
         * @return the constraint builder; never null
         */
        public AndBuilder<UpperBoundary> literal( Binary literal ) {
            return new AndBuilder<UpperBoundary>(new UpperBoundary(comparisonBuilder, new Literal(literal)));
        }
View Full Code Here

         *
         * @param literal the literal value;
         * @return the constraint builder; never null
         */
        public AndBuilder<UpperBoundary> literal( BigDecimal literal ) {
            return new AndBuilder<UpperBoundary>(new UpperBoundary(comparisonBuilder, new Literal(literal)));
        }
View Full Code Here

         *
         * @param literal the literal value;
         * @return the constraint builder; never null
         */
        public AndBuilder<UpperBoundary> literal( boolean literal ) {
            return new AndBuilder<UpperBoundary>(new UpperBoundary(comparisonBuilder, new Literal(literal)));
        }
View Full Code Here

        public ConstraintBuilder isIn( Object firstLiteral,
                                       Object... additionalLiterals ) {
            CheckArg.isNotNull(firstLiteral, "firstLiteral");
            Collection<StaticOperand> right = new ArrayList<StaticOperand>();
            right.add(firstLiteral instanceof Literal ? (Literal)firstLiteral : new Literal(firstLiteral));
            for (Object literal : additionalLiterals) {
                right.add(literal instanceof Literal ? (Literal)literal : new Literal(literal));
            }
            return this.constraintBuilder.setConstraint(new SetCriteria(left, right));
        }
View Full Code Here

         *         complete already-started clauses; never null
         */
        public ConstraintBuilder is( Operator operator,
                                     Object literal ) {
            assert operator != null;
            Literal value = literal instanceof Literal ? (Literal)literal : new Literal(literal);
            return this.constraintBuilder.setConstraint(new Comparison(left, operator, value));
        }
View Full Code Here

         */
        public ConstraintBuilder isBetween( Object lowerBoundLiteral,
                                            Object upperBoundLiteral ) {
            assert lowerBoundLiteral != null;
            assert upperBoundLiteral != null;
            Literal lower = lowerBoundLiteral instanceof Literal ? (Literal)lowerBoundLiteral : new Literal(lowerBoundLiteral);
            Literal upper = upperBoundLiteral instanceof Literal ? (Literal)upperBoundLiteral : new Literal(upperBoundLiteral);
            return this.constraintBuilder.setConstraint(new Between(left, lower, upper));
        }
View Full Code Here

         * @return the builder to complete the constraint; never null
         */
        @Override
        public AndBuilder<UpperBoundary> as( String type ) {
            Object literal = typeSystem.getTypeFactory(type).create(value);
            return new AndBuilder<UpperBoundary>(new UpperBoundary(builder, new Literal(literal)));
        }
View Full Code Here

            }
            // Convert the supplied value to the desired value ...
            tokens.consume(')');
            try {
                Object literal = typeFactory.create(value);
                return new Literal(literal);
            } catch (ValueFormatException e) {
                String msg = GraphI18n.valueCannotBeCastToSpecifiedType.text(value,
                                                                             pos.getLine(),
                                                                             pos.getColumn(),
                                                                             typeFactory.getTypeName(),
                                                                             e.getMessage());
                throw new ParsingException(pos, msg);
            }
        }
        // Just create a literal out of the supplied value ...
        return new Literal(parseLiteralValue(tokens, typeSystem));
    }
View Full Code Here

     * @return the value of the static operand
     */
    protected Object getValue( QueryContext context,
                               StaticOperand operand ) {
        if (operand instanceof Literal) {
            Literal literal = (Literal)operand;
            return literal.getValue();
        }
        BindVariableName variable = (BindVariableName)operand;
        return context.getVariables().get(variable.getVariableName());
    }
View Full Code Here

TOP

Related Classes of org.jboss.dna.graph.query.model.Literal

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.