Package org.omegat.util
Class InlineTagHandler
java.lang.Object
org.omegat.util.InlineTagHandler
This class handles inline tags, i.e. helps to replace all tags into
shortcuts. It handles bpt,ept,it tags numeration.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionendBPT()Handle "bpt" tag end.endEPT()Handle "ept" tag end.endIT()Handle "IT" tag end.intendOTHER()Handle other tag end.endPH()Handle "PH" tag end.Returns current begin/end mark of "it" tag.booleanReturns whether the current tag is externally matched (has a TMX "x" attribute)intGet stored shortcut letter for current other tag.intGet stored shortcut letter for current 'i' value.intHandle paired tag end.voidreset()Reset stored info for process new part of XML.voidsetCurrentPos(String currentPos) Remember current begin/end mark of "it" tag.voidsetOtherTagShortcutLetter(int letter) Store shortcut letter for current other tag.voidsetTagShortcutLetter(int letter) Store shortcut letter for current 'i' value.voidHandle "bpt" tag start.voidHandle "bpt" tag start for TMX.voidHandle "ept" tag start.voidHandle "it" tag start for TMX.voidHandle other tag start.voidHandle "ph" tag start for TMX.
-
Constructor Details
-
InlineTagHandler
public InlineTagHandler()
-
-
Method Details
-
reset
public void reset()Reset stored info for process new part of XML. -
startBPT
Handle "bpt" tag start for TMX. OmegaT internal tag number will be based off the x attr (if provided).- Parameters:
i- TMX i attribute valuex- TMX x attribute value (can be null)
-
startIT
Handle "it" tag start for TMX. OmegaT internal tag number will be based off the x attr (if provided).- Parameters:
x- TMX x attribute value (can be null)
-
startPH
Handle "ph" tag start for TMX. OmegaT internal tag number will be based off the x attr (if provided).- Parameters:
x- TMX x attribute value (can be null)
-
startBPT
Handle "bpt" tag start. Identifier will be first non-null attribute in provided attributes. OmegaT internal tag number will be its index in the list of tags in the segment (starting with 0).- Parameters:
attributeValues- attributes to identify pairs
-
setTagShortcutLetter
public void setTagShortcutLetter(int letter) Store shortcut letter for current 'i' value.- Parameters:
letter- letter to store
-
getTagShortcutLetter
public int getTagShortcutLetter()Get stored shortcut letter for current 'i' value.- Returns:
-
setOtherTagShortcutLetter
public void setOtherTagShortcutLetter(int letter) Store shortcut letter for current other tag.- Parameters:
letter- letter to store
-
getOtherTagShortcutLetter
public int getOtherTagShortcutLetter()Get stored shortcut letter for current other tag.- Returns:
-
startEPT
Handle "ept" tag start.- Parameters:
attributeValues- attributes to identify pairs
-
startOTHER
public void startOTHER()Handle other tag start. -
endBPT
Handle "bpt" tag end.- Returns:
- shortcut index
-
endIT
Handle "IT" tag end.- Returns:
- shortcut index
-
endPH
Handle "PH" tag end.- Returns:
- shortcut index
-
endEPT
Handle "ept" tag end.- Returns:
- shortcut index
-
endOTHER
public int endOTHER()Handle other tag end.- Returns:
- shortcut index
-
paired
Handle paired tag end.- Returns:
- shortcut index
-
setCurrentPos
Remember current begin/end mark of "it" tag. -
getCurrentPos
Returns current begin/end mark of "it" tag. -
getIsExternallyMatched
public boolean getIsExternallyMatched()Returns whether the current tag is externally matched (has a TMX "x" attribute)
-