@Test public void testNullFilter() throws Exception { PropertyIsNull nullFilter = ff.isNull(ff.property("measurement/result")); Filter unrolled = (Filter) nullFilter.accept(visitor, null); assertTrue(unrolled instanceof PropertyIsNull); assertNotSame(nullFilter, unrolled); PropertyIsNull unmapped = (PropertyIsNull) unrolled; Expression unmappedAtt = unmapped.getExpression(); assertTrue(unmappedAtt instanceof PropertyName); assertEquals("results_value", ((PropertyName) unmappedAtt).getPropertyName()); }
public Object visit(PropertyIsNull filter, Object notUsed) { if (original == null) original = filter; if (!fcs.supports(PropertyIsNull.class)) { postStack.push(filter); return null; } int i = postStack.size(); ((PropertyIsNull) filter).getExpression().accept(this, null); if (i < postStack.size()) { postStack.pop(); postStack.push(filter); } preStack.pop(); // null preStack.push(filter); return null; }