Package org.opengis.filter

Examples of org.opengis.filter.Filter.accept()


    @Test
    public void testSample() throws Exception {
        Filter filter = CQL.toFilter(FilterCQLSample.LESS_FILTER_SAMPLE);
        FilterToCQL toCQL = new FilterToCQL();
       
        String output = filter.accept( toCQL, null ).toString();
        Assert.assertNotNull( output );
        Assert.assertEquals( FilterCQLSample.LESS_FILTER_SAMPLE, output );
    }
   
    @Test
View Full Code Here


    protected void cqlTest( String cql ) throws Exception {
        Filter filter = CQL.toFilter(cql);
        Assert.assertNotNull( filter );
       
        FilterToCQL toCQL = new FilterToCQL();
        String output = filter.accept( toCQL, null ).toString();
        Assert.assertEquals( cql,output );       
    }
   
}
View Full Code Here

            int j = preStack.size();
          if (filter instanceof Not) {
               
              if (((Not)filter).getFilter() != null) {
                  Filter next = ((Not)filter).getFilter();
          next.accept(this, null);
                 
                  if (i < postStack.size()) {
                    // since and can split filter into both pre and post parts
                    // the parts have to be combined since ~(A^B) == ~A | ~B
                    // combining is easy since filter==combined result however both post and pre stacks
View Full Code Here

              if (filter instanceof Or) {
                  Filter orReplacement;
 
                  try {
                      orReplacement = translateOr((Or)filter);
                      orReplacement.accept(this, null);
                  } catch (IllegalFilterException e) {
                    popToSize(preStack,j);
                    postStack.push(filter);
                      return;
                  }
View Full Code Here

                    // it's an AND
                    Iterator it = ((And)filter).getChildren().iterator();
                   
                  while (it.hasNext()) {
                      Filter next = (Filter) it.next();
            next.accept(this, null);
                  }
 
                  //combine the unsupported and add to the top
                  if (i < postStack.size()) {
                      if (filter instanceof And) {
View Full Code Here

       
        StringBuilder output = new StringBuilder();
        Iterator<Filter> iter = filterList.iterator();
        while( iter.hasNext() ){
          Filter filter = iter.next();
            filter.accept( toCQL, output );
            if(iter.hasNext() ){
                output.append("; ");
            }
        }       
        return output.toString();       
View Full Code Here

     */
    protected Object visit( BinaryLogicOperator filter, Object data ) {
        if (filter.getChildren() != null) {
            for (Iterator<Filter> i = filter.getChildren().iterator(); i.hasNext();) {
                Filter child = i.next();
                child.accept(this, data);
            }
        }
      return filter;
    }
   
View Full Code Here

        String fid1 = "FID.1";
        // not id filter does not actually have a valid encoding
        Filter filter = factory.not( factory.id( Collections.singleton( factory.featureId(fid1) ) ) );

        FilterEncodingPreProcessor visitor = new FilterEncodingPreProcessor(XMLHandlerHints.VALUE_FILTER_COMPLIANCE_LOW);
        filter.accept(visitor,null);

        assertEquals(filter, visitor.getFilter());
       
        assertTrue(visitor.getFidFilter().getIdentifiers().isEmpty());
View Full Code Here

       
        assertTrue(visitor.getFidFilter().getIdentifiers().isEmpty());

        //Test MEDIUM compliance
        visitor = new FilterEncodingPreProcessor(XMLHandlerHints.VALUE_FILTER_COMPLIANCE_MEDIUM);
        filter.accept(visitor,null);
       
        assertEquals(Filter.INCLUDE, visitor.getFilter());
        assertTrue(visitor.getFidFilter().getIdentifiers().isEmpty());
        assertTrue(visitor.requiresPostProcessing());
View Full Code Here

        assertTrue(visitor.getFidFilter().getIdentifiers().isEmpty());
        assertTrue(visitor.requiresPostProcessing());

        //Test HIGH compliance
        visitor = new FilterEncodingPreProcessor(XMLHandlerHints.VALUE_FILTER_COMPLIANCE_HIGH);
        filter.accept(visitor,null);

        assertEquals(Filter.INCLUDE, visitor.getFilter());
        assertTrue(visitor.getFidFilter().getIdentifiers().isEmpty());
        assertTrue(visitor.requiresPostProcessing());
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.