Class AbstractMarkupEventBuilder
- java.lang.Object
-
- net.sf.okapi.common.filters.EventBuilder
-
- net.sf.okapi.filters.abstractmarkup.AbstractMarkupEventBuilder
-
public class AbstractMarkupEventBuilder extends EventBuilder
-
-
Constructor Summary
Constructors Constructor Description AbstractMarkupEventBuilder(String rootId, IFilter subFilter, EncoderManager encoderManager, String encoding, String lineBreak)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringgetEncoding()protected StringgetLineBreak()voidinitializeCodeFinder(boolean useCodeFinder, String rules)Initializes the code finder.voidinitializeCodeFinder(boolean useCodeFinder, List<String> rules)Initializes the code finder.StringnormalizeHtmlText(String text, boolean insideAttribute, boolean preserveWhitespace)protected ITextUnitpostProcessTextUnit(ITextUnit textUnit)Do any required post-processing on the TextUnit after endTextUnit is called.-
Methods inherited from class net.sf.okapi.common.filters.EventBuilder
addDocumentPart, addFilterEvent, addFilterEvents, addTextUnit, addToDocumentPart, addToTextUnit, addToTextUnit, addToTextUnit, addToTextUnit, addToTextUnit, appendCodeInlineExcludedData, appendCodeOuterData, appendToFirstSkeletonPart, appendToSkeleton, cancel, canStartNewTextUnit, convertTempTextUnitToDocumentPart, endCode, endCode, endDocumentPart, endDocumentPart, endGroup, endGroup, endSubDocument, endTextUnit, endTextUnit, endTextUnit, findMostRecentParentId, findMostRecentParentName, findMostRecentTextUnitName, flushRemainingTempEvents, getCurrentCode, getDocumentPartId, getGroupId, getGroupIdSequence, getRootId, getSubDocumentId, getTextUnitId, hasNext, hasParentTextUnit, hasQueuedEvents, hasUnfinishedSkeleton, isCurrentComplexTextUnit, isCurrentGroup, isCurrentSubfilter, isCurrentTextUnit, isInsideTextRun, isPreserveWhitespace, isTextUnitWithSameType, next, peekMostRecentCode, peekMostRecentGroup, peekMostRecentSubDocument, peekMostRecentTextUnit, peekTempEvent, popTempEvent, reset, setDocumentPartId, setGroupIdSequence, setMimeType, setPreserveWhitespace, setTextUnitId, setTextUnitMimeType, setTextUnitName, setTextUnitPreserveWhitespace, setTextUnitTranslatable, setTextUnitType, startCode, startDocumentPart, startDocumentPart, startDocumentPart, startGroup, startGroup, startSubDocument, startTextUnit, startTextUnit, startTextUnit, startTextUnit, startTextUnit, startTextUnit
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
-
-
-
Constructor Detail
-
AbstractMarkupEventBuilder
public AbstractMarkupEventBuilder(String rootId, IFilter subFilter, EncoderManager encoderManager, String encoding, String lineBreak)
-
-
Method Detail
-
initializeCodeFinder
public void initializeCodeFinder(boolean useCodeFinder, String rules)Initializes the code finder. this must be called before the first time using it, for example when starting to process the inputs.- Parameters:
useCodeFinder- true to use the code finder.rules- the string representation of the rules.
-
initializeCodeFinder
public void initializeCodeFinder(boolean useCodeFinder, List<String> rules)Initializes the code finder. this must be called before the first time using it, for example when starting to process the inputs.- Parameters:
useCodeFinder- true to use the code finder.rules- the string representation of the rules.
-
postProcessTextUnit
protected ITextUnit postProcessTextUnit(ITextUnit textUnit)
Description copied from class:EventBuilderDo any required post-processing on the TextUnit after endTextUnit is called. Default implementation leaves TextUnit unchanged. Override this method if you need to do format specific handing such as collapsing whitespace.- Overrides:
postProcessTextUnitin classEventBuilder- Parameters:
textUnit- theITextUnitto post-process.- Returns:
- the post-processed
ITextUnit.
-
normalizeHtmlText
public String normalizeHtmlText(String text, boolean insideAttribute, boolean preserveWhitespace)
-
getEncoding
protected String getEncoding()
-
getLineBreak
protected String getLineBreak()
-
-