Class InlineTagHandler

java.lang.Object
org.omegat.util.InlineTagHandler

public class InlineTagHandler extends Object
This class handles inline tags, i.e. helps to replace all tags into shortcuts. It handles bpt,ept,it tags numeration.
  • Constructor Details

    • InlineTagHandler

      public InlineTagHandler()
  • Method Details

    • reset

      public void reset()
      Reset stored info for process new part of XML.
    • startBPT

      public void startBPT(String i, 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 value
      x - TMX x attribute value (can be null)
    • startIT

      public void startIT(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(String x)
      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

      public void startBPT(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(String... attributeValues)
      Handle "ept" tag start.
      Parameters:
      attributeValues - attributes to identify pairs
    • startOTHER

      public void startOTHER()
      Handle other tag start.
    • endBPT

      public Integer endBPT()
      Handle "bpt" tag end.
      Returns:
      shortcut index
    • endIT

      public Integer endIT()
      Handle "IT" tag end.
      Returns:
      shortcut index
    • endPH

      public Integer endPH()
      Handle "PH" tag end.
      Returns:
      shortcut index
    • endEPT

      public Integer endEPT()
      Handle "ept" tag end.
      Returns:
      shortcut index
    • endOTHER

      public int endOTHER()
      Handle other tag end.
      Returns:
      shortcut index
    • paired

      public int paired(String tagName, Tag.Type tagType)
      Handle paired tag end.
      Returns:
      shortcut index
    • setCurrentPos

      public void setCurrentPos(String currentPos)
      Remember current begin/end mark of "it" tag.
    • getCurrentPos

      public 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)