/** * {@inheritDoc} * * @see java.lang.Object#hashCode() */ @Override public int hashCode() { return getValue().hashCode(); }
/** * Define the right-hand-side of the constraint using the supplied * operator. * * @param operator * the operator; may not be null * @param literal * the literal value * @return the builder used to create the constraint clause, ready to be * used to create other constraints clauses or 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)); }
public final Literal numericLiteral() throws RecognitionException { Literal res = null; CommonTree l=null; try { // org/xcmis/search/parser/CMISSQLTreeWalker.g:1042:3: (l= NUMERIC_LITERAL ) // org/xcmis/search/parser/CMISSQLTreeWalker.g:1043:3: l= NUMERIC_LITERAL { l=(CommonTree)match(input,NUMERIC_LITERAL,FOLLOW_NUMERIC_LITERAL_in_numericLiteral2430); String val = l.getText(); val = removeQuotes(val,'\''); res = new Literal(Double.parseDouble(val)); } } catch (RecognitionException e) { throw e; } finally { } return res; } // $ANTLR end "numericLiteral"
/** * @see org.xcmis.search.QueryObjectModelVisitor#visit(org.xcmis.search.model.operand.Literal) */ public void visit(Literal node) throws VisitException { queryBuilderStack.push(node.getValue()); }
public final Literal stringLiteral() throws RecognitionException { Literal res = null; CommonTree l=null; try { // org/xcmis/search/parser/CMISSQLTreeWalker.g:1029:3: (l= STRING_LITERAL ) // org/xcmis/search/parser/CMISSQLTreeWalker.g:1030:3: l= STRING_LITERAL { l=(CommonTree)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_stringLiteral2401); String val = l.getText(); val = processLiteral(val); //val = removeQuotes(val,'\''); res = new Literal(val); } } catch (RecognitionException e) { throw e; } finally { } return res; } // $ANTLR end "stringLiteral"
public final Constraint likePredicate() throws RecognitionException { Constraint res = null; CommonTree l=null; PropertyValue cr = null; try { // org/xcmis/search/parser/CMISSQLTreeWalker.g:725:3: ( ^( LIKE cr= columnReference l= STRING_LITERAL ) ) // org/xcmis/search/parser/CMISSQLTreeWalker.g:726:3: ^( LIKE cr= columnReference l= STRING_LITERAL ) { match(input,LIKE,FOLLOW_LIKE_in_likePredicate1514); match(input, Token.DOWN, null); pushFollow(FOLLOW_columnReference_in_likePredicate1518); cr=columnReference(); state._fsp--; l=(CommonTree)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_likePredicate1522); match(input, Token.UP, null); String val = l.getText(); val = processLIKELiteral(val); res=new Comparison(cr, Operator.LIKE, new Literal(val)); } } catch (RecognitionException e) { throw e; } finally { } return res; } // $ANTLR end "likePredicate"
public final Literal dateTimeLiteral() throws RecognitionException { Literal res = null; CommonTree sl=null; try { // org/xcmis/search/parser/CMISSQLTreeWalker.g:1063:3: ( TIMESTAMP sl= STRING_LITERAL ) // org/xcmis/search/parser/CMISSQLTreeWalker.g:1064:3: TIMESTAMP sl= STRING_LITERAL { match(input,TIMESTAMP,FOLLOW_TIMESTAMP_in_dateTimeLiteral2492); sl=(CommonTree)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_dateTimeLiteral2496); String date = processLiteral(sl.getText()); // {res = new Literal(ISO8601.parse(date));} {res = new Literal(CmisUtils.parseCalendar(date));} } } catch (RecognitionException e) { throw e; } finally { } return res; } // $ANTLR end "dateTimeLiteral"