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 class
TMXEntry.ExternalLinked
-
Field Summary
Fields Modifier and Type Field Description long
changeDate
java.lang.String
changer
long
creationDate
java.lang.String
creator
boolean
defaultTranslation
TMXEntry.ExternalLinked
linked
java.lang.String
note
java.lang.String
origin
java.lang.String
source
java.lang.String
translation
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
boolean
equalsTranslation(TMXEntry other)
Two TMXEntrys are considered interchangeable if this method returns true, even if equals() != true.long
getChangeDate()
Gets the EPOCH timestamp for last change in this entryjava.lang.String
getChanger()
Gets the author of last change in the entrylong
getCreationDate()
Gets the initial creation date as an EPOCH timestampjava.lang.String
getCreator()
Gets the initial creator of the entryjava.lang.String
getNote()
Gets text note (markup <note> in TMX format)java.util.List<TMXProp>
getProperties()
return properties.java.lang.String
getPropValue(java.lang.String propType)
Return origin property when requested.java.lang.String
getSourceText()
Gets the source textjava.lang.String
getTranslationText()
Gets translation textint
hashCode()
boolean
hasProperties()
We only hold origin property in TMXEntry.boolean
hasPropValue(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:ITranslationEntry
Gets the source text- Specified by:
getSourceText
in interfaceITranslationEntry
-
getTranslationText
public java.lang.String getTranslationText()
Description copied from interface:ITranslationEntry
Gets translation text- Specified by:
getTranslationText
in interfaceITranslationEntry
-
getCreator
public java.lang.String getCreator()
Description copied from interface:ITMXEntry
Gets the initial creator of the entry- Specified by:
getCreator
in interfaceITMXEntry
-
getCreationDate
public long getCreationDate()
Description copied from interface:ITMXEntry
Gets the initial creation date as an EPOCH timestamp- Specified by:
getCreationDate
in interfaceITMXEntry
-
getChanger
public java.lang.String getChanger()
Description copied from interface:ITMXEntry
Gets the author of last change in the entry- Specified by:
getChanger
in interfaceITMXEntry
-
getChangeDate
public long getChangeDate()
Description copied from interface:ITMXEntry
Gets the EPOCH timestamp for last change in this entry- Specified by:
getChangeDate
in interfaceITMXEntry
-
getNote
public java.lang.String getNote()
Description copied from interface:ITMXEntry
Gets text note (markup <note> in TMX format)
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in 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:
hasProperties
in 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:
getPropValue
in 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:
hasPropValue
in 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:
getProperties
in interfaceITMXEntry
- Returns:
- singletonList of mtsource when it has, otherwise null.
-
-