Class TMXEntry

java.lang.Object
org.omegat.core.data.TMXEntry
All Implemented Interfaces:
ITMXEntry, ITranslationEntry

public class TMXEntry extends Object implements ITMXEntry
Storage for TMX entry. Variables in this class can be changed only before store to ProjectTMX. After that, all values must be unchangeable. Only RealProject can create and change TMXEntry objects.
  • Field Details

    • source

      public final String source
    • translation

      public final String translation
    • changer

      public final String changer
    • changeDate

      public final long changeDate
    • creator

      public final String creator
    • creationDate

      public final long creationDate
    • note

      public final String note
    • defaultTranslation

      public final boolean defaultTranslation
    • linked

      public final TMXEntry.ExternalLinked linked
    • origin

      public final String origin
  • Method Details

    • getSourceText

      public String getSourceText()
      Description copied from interface: ITranslationEntry
      Gets the source text
      Specified by:
      getSourceText in interface ITranslationEntry
    • getTranslationText

      public String getTranslationText()
      Description copied from interface: ITranslationEntry
      Gets translation text
      Specified by:
      getTranslationText in interface ITranslationEntry
    • getCreator

      public String getCreator()
      Description copied from interface: ITMXEntry
      Gets the initial creator of the entry
      Specified by:
      getCreator in interface ITMXEntry
    • getCreationDate

      public long getCreationDate()
      Description copied from interface: ITMXEntry
      Gets the initial creation date as an EPOCH timestamp
      Specified by:
      getCreationDate in interface ITMXEntry
    • getChanger

      public String getChanger()
      Description copied from interface: ITMXEntry
      Gets the author of last change in the entry
      Specified by:
      getChanger in interface ITMXEntry
    • getChangeDate

      public long getChangeDate()
      Description copied from interface: ITMXEntry
      Gets the EPOCH timestamp for last change in this entry
      Specified by:
      getChangeDate in interface ITMXEntry
    • getNote

      public String getNote()
      Description copied from interface: ITMXEntry
      Gets text note (markup <note> in TMX format)
      Specified by:
      getNote in interface ITMXEntry
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equalsTranslation

      public boolean equalsTranslation(TMXEntry other)
      Two TMXEntrys are considered interchangeable if this method returns true, even if equals() != true.
    • hasProperties

      public boolean hasProperties()
      We only hold origin property in TMXEntry.
      Specified by:
      hasProperties in interface ITMXEntry
      Returns:
      true when has origin property, otherwise false.
    • getPropValue

      public String getPropValue(String propType)
      Return origin property when requested.
      Specified by:
      getPropValue in interface ITMXEntry
      Parameters:
      propType - property type. Currently we just support origin.
      Returns:
      mtsource when requested, otherwise null.
    • hasPropValue

      public boolean hasPropValue(String propType, String propValue)
      Query specified property type/value combination.
      Specified by:
      hasPropValue in interface ITMXEntry
      Parameters:
      propType - property type.
      propValue - expected value.
      Returns:
      true when hold a queried type/value, otherwise false.
    • getProperties

      public List<TMXProp> getProperties()
      return properties.
      Specified by:
      getProperties in interface ITMXEntry
      Returns:
      singletonList of mtsource when it has, otherwise null.