/** * Sets the match pattern for this FilterLike. * * @param p the expression which evaluates to the match pattern for this filter * @param wildcardMulti the string that represents a mulitple character (1->n) wildcard * @param wildcardSingle the string that represents a single character (1) wildcard * @param escape the string that represents an escape character * @deprecated use one of {@link PropertyIsLike#setExpression(Expression)} {@link * PropertyIsLike#setWildCard(String)} {@link PropertyIsLike#setSingleChar(String)} {@link * PropertyIsLike#setEscape(String)} */ public final void setPattern( org.opengis.filter.expression.Expression p, String wildcardMulti, String wildcardSingle, String escape) { if (p instanceof Literal) { Literal literal = (Literal) p; Object value = literal.getValue(); if (value != null && value instanceof String) { String pattern = (String) value; setPattern(pattern, wildcardMulti, wildcardSingle, escape); } else { throw new ClassCastException("Pattern Literal must be a string:" + value); } } else { throw new ClassCastException("Pattern must be a literal String"); } }
public PropertyIsLike like( Expression expr, String pattern, String wildcard, String singleChar, String escape, boolean matchCase, MatchAction matchAction) { LikeFilterImpl filter = new LikeFilterImpl(matchAction); filter.setExpression(expr); filter.setPattern(pattern, wildcard, singleChar, escape); filter.setMatchingCase(matchCase); return filter; }
public PropertyIsLike like( Expression expr, String pattern, String wildcard, String singleChar, String escape, boolean matchCase) { LikeFilterImpl filter = new LikeFilterImpl(); filter.setExpression(expr); filter.setPattern(pattern, wildcard, singleChar, escape); filter.setMatchingCase(matchCase); return filter; }
.setPattern(expression, wildcard, singleChar, escapeChar); curState = "complete"; } else {
public void testLikeFilter() throws IllegalFilterException { LikeFilterImpl lFilter1 = new LikeFilterImpl(); LikeFilterImpl lFilter2 = new LikeFilterImpl(); String pattern = "te_st!"; String wcMulti = "!"; String wcSingle = "_"; String escape = "#"; testExp2 = new LiteralExpressionImpl(Integer.valueOf(45)); testExp3 = new AttributeExpressionImpl(testSchema, "testInteger"); testExp4 = new AttributeExpressionImpl(testSchema, "testInteger"); lFilter1.setExpression(testExp3); lFilter2.setExpression(testExp4); lFilter1.setPattern(pattern, wcMulti, wcSingle, escape); lFilter2.setPattern(pattern, wcMulti, wcSingle, escape); assertTrue(lFilter1.equals(lFilter2)); lFilter2.setPattern("te__t!", wcMulti, wcSingle, escape); assertTrue(!lFilter1.equals(lFilter2)); lFilter2.setPattern(pattern, wcMulti, wcSingle, escape); lFilter2.setExpression(testExp2); assertTrue(!lFilter1.equals(lFilter2)); }
/** * Sets the match pattern for this FilterLike. * * @param p the expression which evaluates to the match pattern for this * filter * @param wildcardMulti the string that represents a mulitple character * (1->n) wildcard * @param wildcardSingle the string that represents a single character (1) * wildcard * @param escape the string that represents an escape character * * @deprecated use one of * {@link PropertyIsLike#setExpression(Expression)} * {@link PropertyIsLike#setWildCard(String)} * {@link PropertyIsLike#setSingleChar(String)} * {@link PropertyIsLike#setEscape(String)} */ public final void setPattern(Expression p, String wildcardMulti, String wildcardSingle, String escape) { setPattern(p.toString(), wildcardMulti, wildcardSingle, escape); }
/** * Sets the match pattern for this FilterLike. * * @param p the expression which evaluates to the match pattern for this * filter * @param wildcardMulti the string that represents a mulitple character * (1->n) wildcard * @param wildcardSingle the string that represents a single character (1) * wildcard * @param escape the string that represents an escape character * * @deprecated use one of * {@link PropertyIsLike#setExpression(Expression)} * {@link PropertyIsLike#setWildCard(String)} * {@link PropertyIsLike#setSingleChar(String)} * {@link PropertyIsLike#setEscape(String)} */ public final void setPattern(org.geotools.filter.Expression p, String wildcardMulti, String wildcardSingle, String escape) { setPattern(p.toString(), wildcardMulti, wildcardSingle, escape); }
public PropertyIsLike like(Expression expr, String pattern, String wildcard, String singleChar, String escape) { LikeFilterImpl filter = new LikeFilterImpl(); filter.setExpression(expr); filter.setPattern(pattern,wildcard,singleChar,escape); return filter; }
public PropertyIsLike like(Expression expr, String pattern, String wildcard, String singleChar, String escape, boolean matchCase) { LikeFilterImpl filter = new LikeFilterImpl(); filter.setExpression(expr); filter.setPattern(pattern,wildcard,singleChar,escape); filter.setMatchingCase( matchCase ); return filter; }
public PropertyIsLike like(Expression expr, String pattern, String wildcard, String singleChar, String escape, boolean matchCase, MatchAction matchAction) { LikeFilterImpl filter = new LikeFilterImpl(matchAction); filter.setExpression(expr); filter.setPattern(pattern,wildcard,singleChar,escape); filter.setMatchingCase( matchCase ); return filter; }