/** overrides just to avoid the "WHERE" keyword */ public void encode(Filter filter) throws GeometryEncoderException { this.sdeSpatialFilters = new ArrayList<SeShapeFilter>(); if (Filter.INCLUDE.equals(filter)) { return; } if (capabilities.fullySupports(filter)) { filter.accept(this, null); } else { throw new GeometryEncoderException( "Filter type " + filter.getClass() + " not supported"); } }
BinaryLogicOperator lf = (BinaryLogicOperator) filter; for (Filter testFilter : lf.getChildren()) { if (!(this.fullySupports(testFilter))) { supports = false; break; if (!(this.fullySupports(lf.getFilter()))) { supports = false;
/** overrides just to avoid the "WHERE" keyword */ @Override public void encode(Filter filter) throws FilterToSQLException { if (getCapabilities().fullySupports(filter)) { filter.accept(this, null); } else { throw new FilterToSQLException("Filter type not supported"); } }
/** * Performs the encoding, sends the encoded sql to the writer passed in. * * @param filter the Filter to be encoded. * @throws FilterToSQLException If filter type not supported, or if there were io problems. */ public void encode(Filter filter) throws FilterToSQLException { if (out == null) throw new FilterToSQLException("Can't encode to a null writer."); if (getCapabilities().fullySupports(filter)) { try { if (!inline) { out.write("WHERE "); } filter.accept(this, null); // out.write(";"); } catch (java.io.IOException ioe) { LOGGER.warning("Unable to export filter" + ioe); throw new FilterToSQLException("Problem writing filter: ", ioe); } } else { throw new FilterToSQLException("Filter type not supported: " + filter); } }
/** * Override done to ensure we don't complain if there is a BBOX filter, even if we claim not to * support it */ public void encode(Filter filter) throws FilterToSQLException { if (out == null) throw new FilterToSQLException("Can't encode to a null writer."); // hack, we lied about being able to support BBOX, because the implementation is // just partial, so here don't complain if we got one, it means the dialect already // set the filter correctly FilterCapabilities caps = createFilterCapabilities(); caps.addType(BBOX.class); if (caps.fullySupports(filter)) { try { if (!inline) { out.write("WHERE "); } filter.accept(this, null); } catch (java.io.IOException ioe) { LOGGER.warning("Unable to export filter" + ioe); throw new FilterToSQLException("Problem writing filter: ", ioe); } } else { throw new FilterToSQLException("Filter type not supported"); } }
public void encode(Filter filter) throws FilterToSQLException { if (out == null) throw new FilterToSQLException("Can't encode to a null writer."); original.setWriter(out); JdbcMultipleValueEncoder encoder = new JdbcMultipleValueEncoder(rootMapping, out); filter = (Filter) filter.accept(encoder, null); if (original.getCapabilities().fullySupports(filter)) { try { if (!inline) { out.write("WHERE "); } filter.accept(this, null); // out.write(";"); } catch (java.io.IOException ioe) { throw new FilterToSQLException("Problem writing filter: ", ioe); } } else { throw new FilterToSQLException("Filter type not supported"); } }
public void testFullySupports() { FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(); try { logFilter = ff.and(gFilter, compFilter); assertTrue(capabilities.fullySupports(compFilter)); assertTrue(!(capabilities.fullySupports(gFilter))); assertTrue(!(capabilities.fullySupports(logFilter))); logFilter = ff.and( compFilter, ff.between(ff.property("sample"), ff.literal(1), ff.literal(2))); assertTrue(capabilities.fullySupports(logFilter)); logFilter = ff.or( logFilter, ff.between(ff.property("sample"), ff.literal(1), ff.literal(2))); assertTrue(capabilities.fullySupports(logFilter)); logFilter = ff.and(logFilter, gFilter); assertTrue(!(capabilities.fullySupports(logFilter))); } catch (IllegalFilterException e) { LOGGER.fine("Bad filter " + e); } } }
/** * overrides just to avoid the "WHERE" keyword */ public void encode(Filter filter) throws GeometryEncoderException { this.sdeSpatialFilters = new ArrayList<SeShapeFilter>(); if (Filter.INCLUDE.equals(filter)) { return; } if (capabilities.fullySupports(filter)) { filter.accept(this, null); } else { throw new GeometryEncoderException("Filter type " + filter.getClass() + " not supported"); } }
/** * Performs the encoding, sends the encoded SOLR string to the writer passed in. * * @param filter the Filter to be encoded. * @throws Exception if there were io problems or unsupported filter operation */ public void encode(Filter filter) throws Exception { if (out == null) throw new Exception("Can't encode to a null writer."); if (getCapabilities().fullySupports(filter)) { try { filter.accept(this, out); } catch (Exception ioe) { LOGGER.warning("Unable to export filter" + ioe); throw new Exception("Problem writing filter: ", ioe); } } else { throw new Exception("Filter type not supported"); } }
/** * overrides just to avoid the "WHERE" keyword * */ @Override public void encode(Filter filter) throws FilterToSQLException { if (getCapabilities().fullySupports(filter)) { filter.accept(this, null); } else { throw new FilterToSQLException("Filter type not supported"); } }
/** * Performs the encoding, sends the encoded sql to the writer passed in. * * @param out the writer to encode the SQL to. * @param filter the Filter to be encoded. * * @throws SQLEncoderException If filter type not supported, or if there * were io problems. */ public void encode(Writer out, org.opengis.filter.Filter filter) throws SQLEncoderException { if (getCapabilities().fullySupports(filter)) { this.out = out; try { out.write("WHERE "); Filters.accept( filter, this ); } catch (java.io.IOException ioe) { LOGGER.warning("Unable to export filter" + ioe); throw new SQLEncoderException("Problem writing filter: ", ioe); } } else { throw new SQLEncoderException("Filter type not supported"); } }
/** * Performs the encoding, sends the encoded sql to the writer passed in. * * @param out the writer to encode the SQL to. * @param filter the Filter to be encoded. * * @throws SQLEncoderException If filter type not supported, or if there * were io problems. */ public void encode(Writer out, org.opengis.filter.Filter filter) throws SQLEncoderException { if (getCapabilities().fullySupports(filter)) { this.out = out; try { out.write("WHERE "); Filters.accept( filter, this ); //out.write(";"); } catch (java.io.IOException ioe) { LOGGER.warning("Unable to export filter" + ioe); throw new SQLEncoderException("Problem writing filter: ", ioe); } } else { throw new SQLEncoderException("Filter type not supported"); } }
testFilter = (org.opengis.filter.Filter) filters.next(); if (!(this.fullySupports(testFilter))) { supports = false; break;
testFilter = (org.opengis.filter.Filter) filters.next(); if (!(this.fullySupports(testFilter))) { supports = false; break;
/** * Performs the encoding, sends the encoded sql to the writer passed in. * * @param filter the Filter to be encoded. * * @throws OpenGISFilterToOpenGISFilterToSQLEncoderException If filter type not supported, or if there * were io problems. */ public void encode(Filter filter) throws FilterToSQLException { if (out == null) throw new FilterToSQLException("Can't encode to a null writer."); if (getCapabilities().fullySupports(filter)) { try { if (!inline) { out.write("WHERE "); } filter.accept(this, null); //out.write(";"); } catch (java.io.IOException ioe) { LOGGER.warning("Unable to export filter" + ioe); throw new FilterToSQLException("Problem writing filter: ", ioe); } } else { throw new FilterToSQLException("Filter type not supported"); } }
/** * Convenience constructor to perform the whole encoding process at once. * * @param out the writer to encode the SQL to. * @param filter the Filter to be encoded. * * @throws SQLEncoderException If there were problems encoding */ public SQLEncoder(Writer out, Filter filter) throws SQLEncoderException { if (getCapabilities().fullySupports(filter)) { this.out = out; try { out.write("WHERE "); filter.accept(this); //out.write(";"); this should probably be added by client. } catch (java.io.IOException ioe) { throw new SQLEncoderException("Problem writing filter: ", ioe); } } else { throw new SQLEncoderException("Filter type not supported"); } }
/** * Convenience constructor to perform the whole encoding process at once. * * @param out the writer to encode the SQL to. * @param filter the Filter to be encoded. * * @throws SQLEncoderException If there were problems encoding */ public SQLEncoder(Writer out, Filter filter) throws SQLEncoderException { if (getCapabilities().fullySupports(filter)) { this.out = out; try { out.write("WHERE "); filter.accept(this); //out.write(";"); this should probably be added by client. } catch (java.io.IOException ioe) { throw new SQLEncoderException("Problem writing filter: ", ioe); } } else { throw new SQLEncoderException("Filter type not supported"); } }
/** * Performs the encoding, sends the encoded sql to the writer passed in. * * @param filter the Filter to be encoded. * * @throws OpenGISFilterToOpenGISFilterToSQLEncoderException If filter type not supported, or if there * were io problems. */ public void encode(Filter filter) throws FilterToSQLException { if (out == null) throw new FilterToSQLException("Can't encode to a null writer."); if (getCapabilities().fullySupports(filter)) { try { out.write("WHERE "); filter.accept(this, null); //out.write(";"); } catch (java.io.IOException ioe) { LOGGER.warning("Unable to export filter" + ioe); throw new FilterToSQLException("Problem writing filter: ", ioe); } } else { throw new FilterToSQLException("Filter type not supported"); } }
/** * Performs the encoding, sends the encoded CQL to the writer passed in. * * @param filter the Filter to be encoded. * @throws org.geotools.gui.swing.misc.FilterToCQLException If filter type not supported, or if there * were io problems. * */ public void encode(Filter filter) throws FilterToCQLException { if (out == null) { throw new FilterToCQLException("Can't encode to a null writer."); } if (getCapabilities().fullySupports(filter)) { filter.accept(this, null); } else { throw new FilterToCQLException("Filter type not supported"); } }
/** * Override done to ensure we don't complain if there is a BBOX filter, even if we claim not to * support it */ public void encode(Filter filter) throws FilterToSQLException { if (out == null) throw new FilterToSQLException("Can't encode to a null writer."); // hack, we lied about being able to support BBOX, because the implementation is // just partial, so here don't complain if we got one, it means the dialect already // set the filter correctly FilterCapabilities caps = createFilterCapabilities(); caps.addType(BBOX.class); if (caps.fullySupports(filter)) { try { if (!inline) { out.write("WHERE "); } filter.accept(this, null); } catch (java.io.IOException ioe) { LOGGER.warning("Unable to export filter" + ioe); throw new FilterToSQLException("Problem writing filter: ", ioe); } } else { throw new FilterToSQLException("Filter type not supported"); } }