Class InlineTagHandler


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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Integer endBPT()
      Handle "bpt" tag end.
      java.lang.Integer endEPT()
      Handle "ept" tag end.
      java.lang.Integer endIT()
      Handle "IT" tag end.
      int endOTHER()
      Handle other tag end.
      java.lang.Integer endPH()
      Handle "PH" tag end.
      java.lang.String getCurrentPos()
      Returns current begin/end mark of "it" tag.
      boolean getIsExternallyMatched()
      Returns whether the current tag is externally matched (has a TMX "x" attribute)
      int getOtherTagShortcutLetter()
      Get stored shortcut letter for current other tag.
      int getTagShortcutLetter()
      Get stored shortcut letter for current 'i' value.
      int paired​(java.lang.String tagName, Tag.Type tagType)
      Handle paired tag end.
      void reset()
      Reset stored info for process new part of XML.
      void setCurrentPos​(java.lang.String currentPos)
      Remember current begin/end mark of "it" tag.
      void setOtherTagShortcutLetter​(int letter)
      Store shortcut letter for current other tag.
      void setTagShortcutLetter​(int letter)
      Store shortcut letter for current 'i' value.
      void startBPT​(java.lang.String... attributeValues)
      Handle "bpt" tag start.
      void startBPT​(java.lang.String i, java.lang.String x)
      Handle "bpt" tag start for TMX.
      void startEPT​(java.lang.String... attributeValues)
      Handle "ept" tag start.
      void startIT​(java.lang.String x)
      Handle "it" tag start for TMX.
      void startOTHER()
      Handle other tag start.
      void startPH​(java.lang.String x)
      Handle "ph" tag start for TMX.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • InlineTagHandler

        public InlineTagHandler()
    • 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 value
        x - 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 value
        x - 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)