use of biblemulticonverter.format.paratext.ParatextCharacterContent.ParatextCharacterContentPart in project BibleMultiConverter by schierlm.
the class AbstractParatextFormat method filterContents.
private void filterContents(List<ParatextCharacterContentPart> parts, EnumSet<KeepIf> partsToKeep) {
for (int i = 0; i < parts.size(); i++) {
ParatextCharacterContentPart part = parts.get(i);
if (part instanceof AutoClosingFormatting) {
KeepIf keepCondition = ((AutoClosingFormatting) part).getKind().getKeepIf();
if (keepCondition != null && !partsToKeep.contains(keepCondition)) {
parts.remove(i);
i--;
continue;
}
}
if (part instanceof ParatextCharacterContentContainer) {
filterContents(((ParatextCharacterContentContainer) part).getContent(), partsToKeep);
}
}
}
Aggregations