Class TranslateEntry

  • All Implemented Interfaces:
    ITranslateCallback

    public abstract class TranslateEntry
    extends java.lang.Object
    implements ITranslateCallback
    Base class for entry translation. This class collects all segments which should be translated, for ability to link prev/next segments for the seconds pass.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getTranslation​(java.lang.String id, java.lang.String origSource)
      Old call without path, for compatibility
      java.lang.String getTranslation​(java.lang.String id, java.lang.String origSource, java.lang.String path)
      Get translation for output to compiled target.
      void linkPrevNextSegments()
      This method called from AbstractFilter if filter require second pass.
      void setPass​(int pass)
      Set current pass number Any filter called in one-pass mode by default.
      • Methods inherited from class java.lang.Object

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

      • setPass

        public void setPass​(int pass)
        Set current pass number Any filter called in one-pass mode by default. But if it require second pass for support prev/next segments, it can set flag 'needSecondPass'.
        Specified by:
        setPass in interface ITranslateCallback
        Parameters:
        pass - The current path number, i.e., 1 or 2
      • getTranslation

        public java.lang.String getTranslation​(java.lang.String id,
                                               java.lang.String origSource,
                                               java.lang.String path)
        Get translation for output to compiled target.
        Specified by:
        getTranslation in interface ITranslateCallback
        Parameters:
        id - ID in source file, or null if ID not supported by format
        origSource - source entry text
        path - path of segment
        Returns:
        translation or null if translation not exist
      • getTranslation

        public java.lang.String getTranslation​(java.lang.String id,
                                               java.lang.String origSource)
        Old call without path, for compatibility
        Specified by:
        getTranslation in interface ITranslateCallback
        Parameters:
        id - ID in source file, or null if ID not supported by format
        origSource - source entry text
        Returns:
        translation or null if translation not exist
      • linkPrevNextSegments

        public void linkPrevNextSegments()
        This method called from AbstractFilter if filter require second pass. It links prev/next segments for multiple translations.
        Specified by:
        linkPrevNextSegments in interface ITranslateCallback