Package org.omegat.util
Class InlineTagHandler
- java.lang.Object
-
- org.omegat.util.InlineTagHandler
-
public class InlineTagHandler extends java.lang.ObjectThis class handles inline tags, i.e. helps to replace all tags into shortcuts. It handles bpt,ept,it tags numeration.
-
-
Constructor Summary
Constructors Constructor Description InlineTagHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.IntegerendBPT()Handle "bpt" tag end.java.lang.IntegerendEPT()Handle "ept" tag end.java.lang.IntegerendIT()Handle "IT" tag end.intendOTHER()Handle other tag end.java.lang.IntegerendPH()Handle "PH" tag end.java.lang.StringgetCurrentPos()Returns current begin/end mark of "it" tag.booleangetIsExternallyMatched()Returns whether the current tag is externally matched (has a TMX "x" attribute)intgetOtherTagShortcutLetter()Get stored shortcut letter for current other tag.intgetTagShortcutLetter()Get stored shortcut letter for current 'i' value.intpaired(java.lang.String tagName, Tag.Type tagType)Handle paired tag end.voidreset()Reset stored info for process new part of XML.voidsetCurrentPos(java.lang.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.voidstartBPT(java.lang.String... attributeValues)Handle "bpt" tag start.voidstartBPT(java.lang.String i, java.lang.String x)Handle "bpt" tag start for TMX.voidstartEPT(java.lang.String... attributeValues)Handle "ept" tag start.voidstartIT(java.lang.String x)Handle "it" tag start for TMX.voidstartOTHER()Handle other tag start.voidstartPH(java.lang.String x)Handle "ph" tag start for TMX.
-
-
-
Method Detail
-
reset
public void reset()
Reset stored info for process new part of XML.
-
startBPT
public void startBPT(java.lang.String i, java.lang.String x)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
public void startIT(java.lang.String x)
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
public void startPH(java.lang.String x)
Handle "ph" 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)
-
startBPT
public void startBPT(java.lang.String... attributeValues)
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
public void startEPT(java.lang.String... attributeValues)
Handle "ept" tag start.- Parameters:
attributeValues- attributes to identify pairs
-
startOTHER
public void startOTHER()
Handle other tag start.
-
endBPT
public java.lang.Integer endBPT()
Handle "bpt" tag end.- Returns:
- shortcut index
-
endIT
public java.lang.Integer endIT()
Handle "IT" tag end.- Returns:
- shortcut index
-
endPH
public java.lang.Integer endPH()
Handle "PH" tag end.- Returns:
- shortcut index
-
endEPT
public java.lang.Integer endEPT()
Handle "ept" tag end.- Returns:
- shortcut index
-
endOTHER
public int endOTHER()
Handle other tag end.- Returns:
- shortcut index
-
paired
public int paired(java.lang.String tagName, Tag.Type tagType)Handle paired tag end.- Returns:
- shortcut index
-
setCurrentPos
public void setCurrentPos(java.lang.String currentPos)
Remember current begin/end mark of "it" tag.
-
getCurrentPos
public java.lang.String 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)
-
-