/** * Add a {@link Code} to the current {@link TextUnit}. Nothing is actionable within the tag (i.e., no properties or * translatable, localizable text) * * @param code * the code type * * @param endCodeNow * do we end the code now or delay? * * @throws OkapiIllegalFilterOperationException if we try to perform an invalid operation. */ public void addToTextUnit(Code code, boolean endCodeNow) { if (!isCurrentTextUnit()) { throw new OkapiIllegalFilterOperationException("Trying to add a Code to a TextUnit that does not exist."); } startCode(code); if (endCodeNow) { endCode(); } }
c.setReferenceFlag(true); startCode(c); endCode(); referencableFilterEvents.add(event); } else {
/** * Add a {@link Code} to the current {@link TextUnit}. The Code contains actionable (i.e., translatable, * localizable) attributes. * * @param code * the code * @param endCodeNow * do we end the code now or delay? * @param locale * the language of the text * @param propertyTextUnitPlaceholders * the list of actionable {@link TextUnit} or {@link Properties} with offset information into the tag. * @throws OkapiIllegalFilterOperationException if we try to perform an invalid operation. */ public void addToTextUnit(Code code, boolean endCodeNow, LocaleId locale, List<PropertyTextUnitPlaceholder> propertyTextUnitPlaceholders) { if (!isCurrentTextUnit()) { throw new OkapiIllegalFilterOperationException("Trying to add Codes to a TextUnit that does not exist."); } currentSkeleton = new GenericSkeleton(); ITextUnit tu = peekMostRecentTextUnit(); if (tu != null) { startCode(code); processAllEmbedded(code.toString(), locale, propertyTextUnitPlaceholders, true, tu); if (endCodeNow) { endCode(); } } currentSkeleton = null; }
c.setReferenceFlag(true); startCode(c); endCode(); referencableFilterEvents.add(fe); } else {