/** * Create a {@link Ending} {@link Event} of type END_GROUP and add it to the event queue. * * @param endMarker * the tags that ends the group. * @return the newly created Ending */ public Ending endGroup(GenericSkeleton endMarker) { return endGroup(endMarker, null, null); }
/** * Flush all remaining events from the {@link Event} queues */ public void flushRemainingTempEvents() { if (hasUnfinishedSkeleton()) { endDocumentPart(); } else if (!tempFilterEventStack.isEmpty()) { // go through filtered object stack and close them one by one while (!tempFilterEventStack.isEmpty()) { Event fe = tempFilterEventStack.peek(); if (fe.getEventType() == EventType.START_GROUP) { StartGroup sg = (StartGroup) fe.getResource(); endGroup((GenericSkeleton) sg.getSkeleton()); } else if (fe.getEventType() == EventType.START_SUBFILTER) { StartSubfilter sf = (StartSubfilter) fe.getResource(); endGroup((GenericSkeleton) sf.getSkeleton()); } else if (fe.getEventType() == EventType.TEXT_UNIT) { endTextUnit(); } } } }