/** * Builds a like filter * * @matchCase * @return a PropertyIsLike * @throws CQLException */ public PropertyIsLike buildLikeFilter(boolean matchCase) throws CQLException { final String WC_MULTI = "%"; final String WC_SINGLE = "_"; final String ESCAPE = "\\"; try { org.opengis.filter.expression.Expression pattern = this.resultStack.popExpression(); org.opengis.filter.expression.Expression expr = this.resultStack.popExpression(); PropertyIsLike f = filterFactory.like( expr, pattern.toString(), WC_MULTI, WC_SINGLE, ESCAPE, matchCase); return f; } catch (IllegalFilterException ife) { throw new CQLException( "Exception building LikeFilter: " + ife.getMessage(), this.cqlSource); } }
"Attempted to construct illegal " + "filter: " + ife.getMessage(), ife);
/** * builds PropertyIsBetween filter * * @return PropertyIsBetween * @throws CQLException */ public PropertyIsBetween buildBetween() throws CQLException { try { org.opengis.filter.expression.Expression sup = this.resultStack.popExpression(); org.opengis.filter.expression.Expression inf = this.resultStack.popExpression(); org.opengis.filter.expression.Expression expr = this.resultStack.popExpression(); PropertyIsBetween filter = filterFactory.between(expr, inf, sup); return filter; } catch (IllegalFilterException ife) { throw new CQLException( "Exception building CompareFilter: " + ife.getMessage(), this.cqlSource); } }
"Attempted to construct illegal filter: " + e.getMessage()); "Attempted to construct illegal filter: " + e.getMessage(), e);
public void testLiteralExpressionImplEquals() { try { Literal testString1 = new LiteralExpressionImpl("test literal"); Literal testString2 = new LiteralExpressionImpl("test literal"); assertTrue(testString1.equals(testString2)); Literal testOtherString = new LiteralExpressionImpl("not test literal"); assertFalse(testString1.equals(testOtherString)); Literal testNumber34 = new LiteralExpressionImpl(Integer.valueOf(34)); assertFalse(testString1.equals(testNumber34)); Literal testOtherNumber34 = new LiteralExpressionImpl(Integer.valueOf(34)); assertTrue(testNumber34.equals(testOtherNumber34)); } catch (IllegalFilterException e) { LOGGER.warning("bad filter " + e.getMessage()); } }
public void testExpressionMath() { try { MathExpressionImpl testMath1; MathExpressionImpl testMath2; testExp1 = new LiteralExpressionImpl(new Double(5)); testExp2 = new LiteralExpressionImpl(new Double(5)); testMath1 = new AddImpl(null, null); testMath1.setExpression1(testExp1); testMath1.setExpression2(testExp2); testMath2 = new AddImpl(null, null); testMath2.setExpression1(testExp2); testMath2.setExpression2(testExp1); assertTrue(testMath1.equals(testMath2)); testExp3 = new LiteralExpressionImpl(Integer.valueOf(4)); testExp4 = new LiteralExpressionImpl(Integer.valueOf(4)); testMath2.setExpression1(testExp3); assertTrue(!testMath1.equals(testMath2)); testMath1.setExpression1(testExp4); assertTrue(testMath1.equals(testMath2)); testMath1 = new SubtractImpl(null, null); testMath1.setExpression1(testExp4); testMath1.setExpression1(testExp2); assertTrue(!testMath1.equals(testMath2)); assertTrue(!testMath1.equals("Random Object that happens to be a string")); } catch (IllegalFilterException e) { LOGGER.warning("bad filter: " + e.getMessage()); } }
/** * Builds a like filter * * @matchCase * * @return a PropertyIsLike * @throws CQLException */ public PropertyIsLike buildLikeFilter(boolean matchCase) throws CQLException { final String WC_MULTI = "%"; final String WC_SINGLE = "_"; final String ESCAPE = "\\"; try { org.opengis.filter.expression.Expression pattern = this.resultStack .popExpression(); org.opengis.filter.expression.Expression expr = this.resultStack .popExpression(); PropertyIsLike f = filterFactory.like(expr, pattern.toString(), WC_MULTI, WC_SINGLE, ESCAPE, matchCase); return f; } catch (IllegalFilterException ife) { throw new CQLException("Exception building LikeFilter: " + ife.getMessage(), this.cqlSource); } }
+ "filter: " + ife.getMessage(), ife);
+ "filter: " + ife.getMessage(), ife);
/** * builds PropertyIsBetween filter * * @return PropertyIsBetween * @throws CQLException */ public PropertyIsBetween buildBetween() throws CQLException { try { org.opengis.filter.expression.Expression sup = this.resultStack .popExpression(); org.opengis.filter.expression.Expression inf = this.resultStack .popExpression(); org.opengis.filter.expression.Expression expr = this.resultStack .popExpression(); PropertyIsBetween filter = filterFactory.between(expr, inf, sup); return filter; } catch (IllegalFilterException ife) { throw new CQLException("Exception building CompareFilter: "+ ife.getMessage(), this.cqlSource); } }
throw new SAXException( "Attempted to construct illegal filter: " + e.getMessage()); "Attempted to construct illegal filter: " + e.getMessage());
throw new SAXException( "Attempted to construct illegal filter: " + e.getMessage()); "Attempted to construct illegal filter: " + e.getMessage());
getFInfoFilter = filterFac.intersects(filterFac.property(finfo.getFeatureType().getGeometryDescriptor().getLocalName()), filterFac.literal(pixelRect)); } catch (IllegalFilterException e) { throw new WmsException(null, "Internal error : " + e.getMessage());
} catch (IllegalFilterException e) { e.printStackTrace(); throw new ServiceException("Internal error : " + e.getMessage(), e);