/** * 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."); } }
/** * 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."); } }
if (logicFactory.isComplete()) { LOGGER.finer("creating logic factory"); parent.filter(logicFactory.create());
if (isComplete()) { LOGGER.finer("filter is complete, with type: " + this.logicType);
/** * 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 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."); } }
if (isComplete()) { LOGGER.finer("filter is complete, with type: " + this.logicType);
if (logicFactory.isComplete()) { LOGGER.finer("creating logic factory"); parent.filter(logicFactory.create());
if (logicFactory.isComplete()) { LOGGER.finer("creating logic factory"); parent.filter(logicFactory.create());