/** * To be called by a parser to start the creation of a logic filter. Can start a nested or a * base logic filter. * * @param logicType OR, or AND abstract filter type. * @throws IllegalFilterException if filter type does not match declared type. */ // logic types are AND=2, OR=1, NOT=3 public void start(short logicType) throws IllegalFilterException { LOGGER.finest("got a start element: " + logicType); if (this.logicType != -1) { // DJB: for GEOS-328 we need to keep the old parser around to handle multiple nestings // of logic operators. if (logicFactory == null) { logicFactory = new LogicSAXParser(); } logicFactory.start(logicType); } else if (!AbstractFilter.isLogicFilter(logicType)) { throw new IllegalFilterException("Add logic filter type does not match declared type."); } else { this.logicType = logicType; } }
/** * Adds a filter to the current logic list. * * @param filter The filter to be added. */ public void add(Filter filter) { LOGGER.finer("added a filter: " + filter.toString()); if (logicFactory != null) { LOGGER.finer("adding to nested logic filter: " + filter.toString()); logicFactory.add(filter); } else { LOGGER.finer("added to sub filters: " + filter.toString()); subFilters.add(filter); } }
/** * To be called when the sax parser reaches the end of a logic filter. Tells this class to * complete. * * @param logicType the Filter type. * @throws IllegalFilterException If the end message can't be processed in this state. */ // logic types are AND=2, OR=1, NOT=3 public void end(short logicType) throws IllegalFilterException { LOGGER.finer("got an end element: " + logicType); if (logicFactory != null) { LOGGER.finer("sending end element to nested logic filter: " + logicType); logicFactory.end(logicType); if (logicFactory.isComplete()) { subFilters.add(logicFactory.create()); logicFactory = null; } } else if (this.logicType == logicType) { LOGGER.finer("end element matched internal type: " + this.logicType); isComplete = true; } else { throw new IllegalFilterException( "Logic Factory got an end message that it can't process."); } }
/** * Constructor with parent, which must implement GMLHandlerJTS. * * @param parent The parent of this filter, to recieve the filters created. * @param schema The schema that the filter will be used against. */ public FilterFilter(FilterHandler parent, SimpleFeatureType schema) { super(); this.parent = parent; this.schema = schema; expressionFactory = new ExpressionSAXParser(schema); filterFactory = new FilterSAXParser(); logicFactory = new LogicSAXParser(); characters = new StringBuffer(); }
/** * Creates the the logic filter if in a complete state. * * @return The created logic filter. * @throws IllegalFilterException if the filter is not complete. */ @SuppressWarnings("deprecation") public Filter create() throws IllegalFilterException { Filter filter = null; LOGGER.finer("creating a logic filter"); if (isComplete()) { LOGGER.finer("filter is complete, with type: " + this.logicType); if (logicType == AbstractFilter.LOGIC_NOT) { filter = ff.not(subFilters.get(0)); } else if (logicType == AbstractFilter.LOGIC_AND) { filter = ff.and(subFilters); } else if (logicType == AbstractFilter.LOGIC_OR) { filter = ff.or(subFilters); } // reset the variables so it works right if called again. subFilters = new ArrayList<Filter>(); this.logicType = -1; isComplete = false; return filter; } else { throw new IllegalFilterException("Attempted to generate incomplete logic filter."); } }
LOGGER.finer("found a logic filter start"); isLogicFilter = true; logicFactory.start(filterType); } else if (AbstractFilter.isSimpleFilter(filterType)) {
/** * Constructor with parent, which must implement GMLHandlerJTS. * * @param parent The parent of this filter, to recieve the filters created. * @param schema The schema that the filter will be used against. */ public FilterFilter(FilterHandler parent, SimpleFeatureType schema) { super(); this.parent = parent; this.schema = schema; expressionFactory = new ExpressionSAXParser(schema); filterFactory = new FilterSAXParser(); logicFactory = new LogicSAXParser(); characters = new StringBuffer(); }
if (isComplete()) { LOGGER.finer("filter is complete, with type: " + this.logicType);
LOGGER.finer("found a logic filter start"); isLogicFilter = true; logicFactory.start(filterType); } else if (AbstractFilter.isSimpleFilter(filterType)) {
logicFactory.end(filterType); if (logicFactory.isComplete()) { LOGGER.finer("creating logic factory"); parent.filter(logicFactory.create());
/** * To be called by a parser to start the creation of a logic filter. Can * start a nested or a base logic filter. * * @param logicType OR, or AND abstract filter type. * * @throws IllegalFilterException if filter type does not match declared * type. */ // logic types are AND=2, OR=1, NOT=3 public void start(short logicType) throws IllegalFilterException { LOGGER.finest("got a start element: " + logicType); if (this.logicType != -1) { //DJB: for GEOS-328 we need to keep the old parser around to handle multiple nestings of logic operators. if (logicFactory == null) { logicFactory = new LogicSAXParser(); } logicFactory.start(logicType); } else if (!AbstractFilter.isLogicFilter(logicType)) { throw new IllegalFilterException( "Add logic filter type does not match declared type."); } else { this.logicType = logicType; } }
private void addFilterToLogicFactory() throws IllegalFilterException { logicFactory.add(filterFactory.create()); expressionFactory = new ExpressionSAXParser(schema); }
/** * Constructor with parent, which must implement GMLHandlerJTS. * * @param parent The parent of this filter, to recieve the filters created. * @param schema The schema that the filter will be used against. */ public FilterFilter(FilterHandler parent, FeatureType schema) { super(); this.parent = parent; this.schema = schema; expressionFactory = new ExpressionSAXParser(schema); filterFactory = new FilterSAXParser(); logicFactory = new LogicSAXParser(); characters = new StringBuffer(); }
if (isComplete()) { LOGGER.finer("filter is complete, with type: " + this.logicType);
LOGGER.finer("found a logic filter start"); isLogicFilter = true; logicFactory.start(filterType); } else if (AbstractFilter.isSimpleFilter(filterType)) {
/** * To be called when the sax parser reaches the end of a logic filter. * Tells this class to complete. * * @param logicType the Filter type. * * @throws IllegalFilterException If the end message can't be processed in * this state. */ // logic types are AND=2, OR=1, NOT=3 public void end(short logicType) throws IllegalFilterException { LOGGER.finer("got an end element: " + logicType); if (logicFactory != null) { LOGGER.finer("sending end element to nested logic filter: " + logicType); logicFactory.end(logicType); if (logicFactory.isComplete()) { subFilters.add(logicFactory.create()); logicFactory = null; } } else if (this.logicType == logicType) { LOGGER.finer("end element matched internal type: " + this.logicType); isComplete = true; } else { throw new IllegalFilterException( "Logic Factory got an end message that it can't process."); } }
/** * To be called by a parser to start the creation of a logic filter. Can * start a nested or a base logic filter. * * @param logicType OR, or AND abstract filter type. * * @throws IllegalFilterException if filter type does not match declared * type. */ // logic types are AND=2, OR=1, NOT=3 public void start(short logicType) throws IllegalFilterException { LOGGER.finest("got a start element: " + logicType); if (this.logicType != -1) { //DJB: for GEOS-328 we need to keep the old parser around to handle multiple nestings of logic operators. if (logicFactory == null) { logicFactory = new LogicSAXParser(); } logicFactory.start(logicType); } else if (!AbstractFilter.isLogicFilter(logicType)) { throw new IllegalFilterException( "Add logic filter type does not match declared type."); } else { this.logicType = logicType; } }
/** * Adds a filter to the current logic list. * * @param filter The filter to be added. */ public void add(Filter filter) { LOGGER.finer("added a filter: " + filter.toString()); if (logicFactory != null) { LOGGER.finer("adding to nested logic filter: " + filter.toString()); logicFactory.add(filter); } else { LOGGER.finer("added to sub filters: " + filter.toString()); subFilters.add(filter); } }
/** * To be called when the sax parser reaches the end of a logic filter. * Tells this class to complete. * * @param logicType the Filter type. * * @throws IllegalFilterException If the end message can't be processed in * this state. */ // logic types are AND=2, OR=1, NOT=3 public void end(short logicType) throws IllegalFilterException { LOGGER.finer("got an end element: " + logicType); if (logicFactory != null) { LOGGER.finer("sending end element to nested logic filter: " + logicType); logicFactory.end(logicType); if (logicFactory.isComplete()) { subFilters.add(logicFactory.create()); logicFactory = null; } } else if (this.logicType == logicType) { LOGGER.finer("end element matched internal type: " + this.logicType); isComplete = true; } else { throw new IllegalFilterException( "Logic Factory got an end message that it can't process."); } }
/** * Adds a filter to the current logic list. * * @param filter The filter to be added. */ public void add(Filter filter) { LOGGER.finer("added a filter: " + filter.toString()); if (logicFactory != null) { LOGGER.finer("adding to nested logic filter: " + filter.toString()); logicFactory.add(filter); } else { LOGGER.finer("added to sub filters: " + filter.toString()); subFilters.add(filter); } }