Package org.omegat.core.data
Class TMXEntry
- java.lang.Object
-
- org.omegat.core.data.TMXEntry
-
- All Implemented Interfaces:
ITMXEntry,ITranslationEntry
public class TMXEntry extends java.lang.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTMXEntry.ExternalLinked
-
Field Summary
Fields Modifier and Type Field Description longchangeDatejava.lang.StringchangerlongcreationDatejava.lang.StringcreatorbooleandefaultTranslationTMXEntry.ExternalLinkedlinkedjava.lang.Stringnotejava.lang.Stringoriginjava.lang.Stringsourcejava.lang.Stringtranslation
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)booleanequalsTranslation(TMXEntry other)Two TMXEntrys are considered interchangeable if this method returns true, even if equals() != true.longgetChangeDate()Gets the EPOCH timestamp for last change in this entryjava.lang.StringgetChanger()Gets the author of last change in the entrylonggetCreationDate()Gets the initial creation date as an EPOCH timestampjava.lang.StringgetCreator()Gets the initial creator of the entryjava.lang.StringgetNote()Gets text note (markup <note> in TMX format)java.util.List<TMXProp>getProperties()return properties.java.lang.StringgetPropValue(java.lang.String propType)Return origin property when requested.java.lang.StringgetSourceText()Gets the source textjava.lang.StringgetTranslationText()Gets translation textinthashCode()booleanhasProperties()We only hold origin property in TMXEntry.booleanhasPropValue(java.lang.String propType, java.lang.String propValue)Query specified property type/value combination.-
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.omegat.core.data.ITranslationEntry
isTranslated
-
-
-
-
Field Detail
-
source
public final java.lang.String source
-
translation
public final java.lang.String translation
-
changer
public final java.lang.String changer
-
changeDate
public final long changeDate
-
creator
public final java.lang.String creator
-
creationDate
public final long creationDate
-
note
public final java.lang.String note
-
defaultTranslation
public final boolean defaultTranslation
-
linked
public final TMXEntry.ExternalLinked linked
-
origin
public final java.lang.String origin
-
-
Method Detail
-
getSourceText
public java.lang.String getSourceText()
Description copied from interface:ITranslationEntryGets the source text- Specified by:
getSourceTextin interfaceITranslationEntry
-
getTranslationText
public java.lang.String getTranslationText()
Description copied from interface:ITranslationEntryGets translation text- Specified by:
getTranslationTextin interfaceITranslationEntry
-
getCreator
public java.lang.String getCreator()
Description copied from interface:ITMXEntryGets the initial creator of the entry- Specified by:
getCreatorin interfaceITMXEntry
-
getCreationDate
public long getCreationDate()
Description copied from interface:ITMXEntryGets the initial creation date as an EPOCH timestamp- Specified by:
getCreationDatein interfaceITMXEntry
-
getChanger
public java.lang.String getChanger()
Description copied from interface:ITMXEntryGets the author of last change in the entry- Specified by:
getChangerin interfaceITMXEntry
-
getChangeDate
public long getChangeDate()
Description copied from interface:ITMXEntryGets the EPOCH timestamp for last change in this entry- Specified by:
getChangeDatein interfaceITMXEntry
-
getNote
public java.lang.String getNote()
Description copied from interface:ITMXEntryGets text note (markup <note> in TMX format)
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.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:
hasPropertiesin interfaceITMXEntry- Returns:
- true when has origin property, otherwise false.
-
getPropValue
public java.lang.String getPropValue(java.lang.String propType)
Return origin property when requested.- Specified by:
getPropValuein interfaceITMXEntry- Parameters:
propType- property type. Currently we just support origin.- Returns:
- mtsource when requested, otherwise null.
-
hasPropValue
public boolean hasPropValue(java.lang.String propType, java.lang.String propValue)Query specified property type/value combination.- Specified by:
hasPropValuein interfaceITMXEntry- Parameters:
propType- property type.propValue- expected value.- Returns:
- true when hold a queried type/value, otherwise false.
-
getProperties
public java.util.List<TMXProp> getProperties()
return properties.- Specified by:
getPropertiesin interfaceITMXEntry- Returns:
- singletonList of mtsource when it has, otherwise null.
-
-