/** * Add the START_SUBDOCUMENT {@link Event} to the event queue. * @return the {@link StartSubDocument} created and added, * or null if there is no <code>subFilter</code> */ public StartSubDocument startSubDocument() { StartSubDocument startSubDocument = null; if (!subFilter) { if (hasUnfinishedSkeleton()) { endDocumentPart(); } startSubDocument = new StartSubDocument(subDocumentId.createId()); Event event = new Event(EventType.START_SUBDOCUMENT, startSubDocument); filterEvents.add(event); LOGGER.debug("Start Sub-Document for " + startSubDocument.getId()); } return startSubDocument; }
/** * 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(); } } } }
/** * Create a {@link DocumentPart} and store it for later processing. * * @param part * the {@link DocumentPart} (aka skeleton) * @return the newly created DocumentPart */ public DocumentPart startDocumentPart(String part) { if (hasUnfinishedSkeleton()) { endDocumentPart(); } else if (isCurrentTextUnit()) { endTextUnit(); } currentSkeleton = new GenericSkeleton(part); currentDocumentPart = new DocumentPart(documentPartId.createId(), false); currentDocumentPart.setSkeleton(currentSkeleton); return currentDocumentPart; }
/** * Create a {@link DocumentPart} that references actionable (i.e., translatable, localizable) properties and store * it for later processing. * * @param part * the {@link DocumentPart} (aka skeleton) * @param name * the name * @param locale * the language of any actionable items * @param propertyTextUnitPlaceholders * the list of actionable {@link TextUnit} or {@link Properties} with offset information into the tag. */ public void startDocumentPart(String part, String name, LocaleId locale, List<PropertyTextUnitPlaceholder> propertyTextUnitPlaceholders) { if (hasUnfinishedSkeleton()) { endDocumentPart(); } else if (isCurrentTextUnit()) { endTextUnit(); } currentSkeleton = new GenericSkeleton(); currentDocumentPart = new DocumentPart(documentPartId.createId(), false); currentDocumentPart.setSkeleton(currentSkeleton); processAllEmbedded(part, locale, propertyTextUnitPlaceholders, false); }
if (hasUnfinishedSkeleton()) { endDocumentPart();
if (hasUnfinishedSkeleton()) { endDocumentPart();