public void encode(Writer out, org.opengis.filter.expression.Expression expression) throws SQLEncoderException { this.out = out; ((DefaultExpression) expression).accept(this); }
private void encodeExpression(DefaultExpression expr) throws IOException { if (expr == null) { out.write("\"" + defaultGeom + "\""); } else { expr.accept(this); } }
/** * * @deprecated use {@link org.opengis.filter.expression.Expression#accept(ExpressionVisitor, Object)} */ public final void accept(FilterVisitor visitor) { accept(new FilterVisitorExpressionWrapper(visitor),null); }
/** * * @deprecated use {@link org.opengis.filter.expression.Expression#accept(ExpressionVisitor, Object)} */ public final void accept(FilterVisitor visitor) { accept(new FilterVisitorExpressionWrapper(visitor),null); }
/** * Writes the SQL for the Null Filter. * * @param filter the null filter to be written to SQL. * * @throws RuntimeException for io exception with writer */ public void visit(NullFilter filter) throws RuntimeException { LOGGER.finer("exporting NullFilter"); DefaultExpression expr = (DefaultExpression) filter.getNullCheckValue(); //String type = (String) comparisions.get(new Integer( // filter.getFilterType())); try { expr.accept(this); out.write(" IS NULL "); } catch (java.io.IOException ioe) { throw new RuntimeException(IO_ERROR, ioe); } }
/** * Writes the SQL for the Null Filter. * * @param filter the null filter to be written to SQL. * * @throws RuntimeException for io exception with writer */ public void visit(NullFilter filter) throws RuntimeException { LOGGER.finer("exporting NullFilter"); DefaultExpression expr = (DefaultExpression) filter.getNullCheckValue(); //String type = (String) comparisions.get(new Integer( // filter.getFilterType())); try { expr.accept(this); out.write(" IS NULL "); } catch (java.io.IOException ioe) { throw new RuntimeException(IO_ERROR, ioe); } }
/** * Writes the SQL for the Math Expression. * * @param expression the Math phrase to be written. * * @throws RuntimeException for io problems */ public void visit(MathExpression expression) throws RuntimeException { LOGGER.finer("exporting Expression Math"); String type = (String) expressions.get(new Integer(expression.getType())); try { ((DefaultExpression) expression.getLeftValue()).accept(this); out.write(" " + type + " "); ((DefaultExpression) expression.getRightValue()).accept(this); } catch (java.io.IOException ioe) { throw new RuntimeException("IO problems writing expression", ioe); } }
/** * Writes the SQL for the Math Expression. * * @param expression the Math phrase to be written. * * @throws RuntimeException for io problems */ public void visit(MathExpression expression) throws RuntimeException { LOGGER.finer("exporting Expression Math"); String type = (String) expressions.get(new Integer(expression.getType())); try { ((DefaultExpression) expression.getLeftValue()).accept(this); out.write(" " + type + " "); ((DefaultExpression) expression.getRightValue()).accept(this); } catch (java.io.IOException ioe) { throw new RuntimeException("IO problems writing expression", ioe); } }
/** * Writes the SQL for the Between Filter. * * @param filter the Filter to be visited. * * @throws RuntimeException for io exception with writer */ public void visit(BetweenFilter filter) throws RuntimeException { LOGGER.finer("exporting BetweenFilter"); DefaultExpression left = (DefaultExpression) filter.getLeftValue(); DefaultExpression right = (DefaultExpression) filter.getRightValue(); DefaultExpression mid = (DefaultExpression) filter.getMiddleValue(); LOGGER.finer("Filter type id is " + filter.getFilterType()); LOGGER.finer("Filter type text is " + comparisions.get(new Integer(filter.getFilterType()))); try { mid.accept(this); out.write(" BETWEEN "); left.accept(this); out.write(" AND "); right.accept(this); } catch (java.io.IOException ioe) { throw new RuntimeException(IO_ERROR, ioe); } }
/** * Writes the SQL for the Between Filter. * * @param filter the Filter to be visited. * * @throws RuntimeException for io exception with writer */ public void visit(BetweenFilter filter) throws RuntimeException { LOGGER.finer("exporting BetweenFilter"); DefaultExpression left = (DefaultExpression) filter.getLeftValue(); DefaultExpression right = (DefaultExpression) filter.getRightValue(); DefaultExpression mid = (DefaultExpression) filter.getMiddleValue(); LOGGER.finer("Filter type id is " + filter.getFilterType()); LOGGER.finer("Filter type text is " + comparisions.get(new Integer(filter.getFilterType()))); try { mid.accept(this); out.write(" BETWEEN "); left.accept(this); out.write(" AND "); right.accept(this); } catch (java.io.IOException ioe) { throw new RuntimeException(IO_ERROR, ioe); } }
left.accept(this); out.write(" isnull"); || right.getType() == Expression.LITERAL_STRING ) { out.write( "lower(" ); left.accept( this ); out.write( ")"); out.write( " " + type + " " ); out.write( "lower(" ); right.accept( this ); out.write( ")"); left.accept(this); out.write(" " + type + " "); right.accept(this);
att.accept(this); out.write(" LIKE '"); out.write(pattern);
att.accept(this); if (!matchCase){ out.write(") LIKE '");
/** * @see org.geotools.filter.FilterVisitor#visit(org.geotools.filter.GeometryFilter) */ public void visit(GeometryFilter filter) { if (filter.getFilterType() == Filter.GEOMETRY_BBOX || filter.getFilterType() == Filter.GEOMETRY_EQUALS || filter.getFilterType() == Filter.GEOMETRY_INTERSECTS || filter.getFilterType() == Filter.GEOMETRY_TOUCHES || filter.getFilterType() == Filter.GEOMETRY_CROSSES || filter.getFilterType() == Filter.GEOMETRY_WITHIN || filter.getFilterType() == Filter.GEOMETRY_CONTAINS || filter.getFilterType() == Filter.GEOMETRY_OVERLAPS || filter.getFilterType() == Filter.GEOMETRY_DWITHIN ) { DefaultExpression left = (DefaultExpression) filter.getLeftGeometry(); DefaultExpression right = (DefaultExpression) filter .getRightGeometry(); if (left != null) { left.accept(this); } if (right != null) { right.accept(this); } } }