public static Filter isNull(final String propertyName) { return factory.isNull(factory.property(propertyName)); }
/** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { return factory.isNull((Expression) node.getChildValue(Expression.class)); }
/** * Builds property is null filter * * @return PropertyIsNull * @throws CQLException */ public PropertyIsNull buildPropertyIsNull() throws CQLException { try { org.opengis.filter.expression.Expression property = this.resultStack.popExpression(); PropertyIsNull filter = filterFactory.isNull(property); return filter; } catch (CQLException e) { throw new CQLException("Exception building Null Predicate", this.cqlSource); } }
filter = ff.isNull(expression); } else { filter = ff.equals(expression, ff.literal(items[item]));
public void testVisitNullFilter() throws Exception { Filter filter = ff.isNull(ff.property(nameAtt)); FilterCapabilities nullCaps = new FilterCapabilities(PropertyIsNull.class); runTest(filter, nullCaps, nameAtt); }
public Measure(Expression unscaled, Unit<Length> defaultUnit) { this.expression = unscaled; setDefaultUnit(defaultUnit); this.uom = defaultUnit; if (unscaled instanceof Literal) { processLiteralExpression((Literal) unscaled, defaultUnit); } else { // see if we can still optimize PropertyIsNull test = ff.isNull(unscaled); Filter simplified = (Filter) test.accept(new SimplifyingFilterVisitor(), null); if (simplified == Filter.INCLUDE) { // special case, the expression was nil to start with this.expression = NilExpression.NIL; this.uom = defaultUnit; } else if (simplified instanceof PropertyIsNull) { PropertyIsNull pin = (PropertyIsNull) simplified; Expression se = pin.getExpression(); if (se instanceof Literal) { processLiteralExpression((Literal) se, defaultUnit); } else { this.expression = se; this.uom = defaultUnit; } } } }
@Test public void testVisitNullFilter() throws Exception { Filter filter = ff.isNull(ff.property(nameAtt)); runTest(filter, newCapabilities(PropertyIsNull.class), nameAtt); }
@Test public void testExistingKeyNullValueAndIsNullGlobal() { EnvFunction.setGlobalValue("foo", null); boolean isNull = ff.isNull(ff.function("env", ff.literal("foo"))).evaluate(null); assertTrue(isNull); }
@Test public void testExistingKeyNullValueAndIsNullLocal() { EnvFunction.setLocalValue("foo", null); boolean isNull = ff.isNull(ff.function("env", ff.literal("foo"))).evaluate(null); assertTrue(isNull); }
public void testIsNullFilter() { FilterCapabilities caps = new FilterCapabilities(); PostPreProcessFilterSplittingVisitor visitor = new PostPreProcessFilterSplittingVisitor(caps, null, null); caps.addType(PropertyIsNull.class); Filter f1 = ff.isNull(ff.literal("abc")); f1.accept(visitor, null); assertEquals(f1, visitor.getFilterPre()); visitor = new PostPreProcessFilterSplittingVisitor(caps, null, null); Filter f2 = ff.isNull(ff.function("strConcat", ff.literal("abc"), ff.literal("def"))); f2.accept(visitor, null); assertEquals(f2, visitor.getFilterPost()); }
public void testDuplicateInternalFunction() throws IllegalFilterException { class TestInternalFunction extends InternalVolatileFunction { @Override public Object evaluate(Object object) { return null; } @Override public InternalFunction duplicate(Expression... parameters) { return new TestInternalFunction(); } } Expression internalFunction = new TestInternalFunction(); Filter filter = fac.isNull(internalFunction); DuplicatingFilterVisitor visitor = new DuplicatingFilterVisitor((FilterFactory2) fac); Filter newFilter = (Filter) filter.accept(visitor, null); assertTrue(newFilter instanceof PropertyIsNull); Expression newExpression = ((PropertyIsNull) newFilter).getExpression(); assertNotNull(newExpression); assertTrue(newExpression instanceof TestInternalFunction); assertNotSame(internalFunction, newExpression); } }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { return factory.isNull((Expression) node.getChildValue(Expression.class)); }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { return factory.isNull((Expression) node.getChildValue(Expression.class)); }
/** * Builds property is null filter * * @return PropertyIsNull * @throws CQLException */ public PropertyIsNull buildPropertyIsNull() throws CQLException { try { org.opengis.filter.expression.Expression property = this.resultStack .popExpression(); PropertyIsNull filter = filterFactory.isNull(property); return filter; } catch (CQLException e) { throw new CQLException("Exception building Null Predicate", this.cqlSource); } }
/** * Builds property is null filter * * @return PropertyIsNull * @throws CQLException */ private PropertyIsNull buildPropertyIsNull() throws CQLException { try { org.opengis.filter.expression.Expression property = resultStack .popExpression(); PropertyIsNull filter = filterFactory.isNull(property); return filter; } catch (CQLException e) { throw new CQLException("Exception building Null Predicate", getToken(0), e, this.cqlSource); } }
public void cleanExpiredStatuses(long expirationThreshold) { Date date = new Date(expirationThreshold); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'"); Not completionTimenotNull = FF.not(FF.isNull(FF.property("completionTime"))); Filter completionTimeExpired = FF.before(FF.property("completionTime"), FF.literal(format.format(date))); Filter completionTimeFilter = FF.and(completionTimenotNull, completionTimeExpired); Not lastUpdatedNotNull = FF.not(FF.isNull(FF.property("lastUpdated"))); Filter lastUpdatedExpired = FF.before(FF.property("lastUpdated"), FF.literal(format.format(date))); Filter lastUpdatedFilter = FF.and(lastUpdatedNotNull, lastUpdatedExpired); And filter = FF.and(completionTimeFilter, lastUpdatedFilter); store.remove(filter); }
null).toString()); org.opengis.filter.Filter nf = factory.isNull(e); return nf; } catch (IllegalFilterException ife) {