de.folt.models.datamodel
Class LinguisticProperty

java.lang.Object
  extended by java.util.Observable
      extended by de.folt.models.datamodel.LinguisticProperty
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
DataSourceCriteria

@Entity
public class LinguisticProperty
extends java.util.Observable
implements java.io.Serializable

A LinguisticProperty is an object which is aimed for storing (attribute/value) information for a MOL or MUL.
It is built up from a key which identifies the property
a value, e.g. a TmxProp or similar object
a status which identifies the object
a status which allows to attach some additional data with the object. The rationality behind the data (in contrast to the value) is that this variable can be used to asscoiate the original object with the property (e.g. an XML Element, if the TmxProp is derived from a Tmx TU or TUV property.

Author:
klemens
See Also:
Serialized Form

Nested Class Summary
static class LinguisticProperty.PropStatus
           
static class LinguisticProperty.PropType
           
 
Constructor Summary
LinguisticProperty()
           
LinguisticProperty(java.lang.Object key, LinguisticProperty.PropStatus propStatus, java.lang.Object value)
           
LinguisticProperty(java.lang.Object key, java.lang.Object value)
           
 
Method Summary
 boolean bCompare(LinguisticProperties compLingProps)
          bCompare check if this LinguisticProperty exists in compLingProps; if yes, return true, otherwise false
 boolean bCompare(LinguisticProperty compLingProp)
          bCompare compare against a LinguisticProperty; the key and the value are "stringified"
 java.lang.String format()
          format
static LinguisticProperty fromJson(java.lang.String linguisticProperty)
          fromJson
 java.lang.Object getData()
           
 java.lang.Object getKey()
           
 LinguisticProperty.PropStatus getPropStatus()
           
 LinguisticProperty.PropType getPropType()
           
 java.lang.Object getValue()
           
 java.lang.String mapToJson()
          mapToJson
 void setData(java.lang.Object data)
           
 void setKey(java.lang.Object key)
           
 void setPropStatus(LinguisticProperty.PropStatus propStatus)
           
 void setPropType(LinguisticProperty.PropType propType)
           
 void setValue(java.lang.Object value)
           
 
Methods inherited from class java.util.Observable
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinguisticProperty

public LinguisticProperty()

LinguisticProperty

public LinguisticProperty(java.lang.Object key,
                          java.lang.Object value)
Parameters:
value -
key -

LinguisticProperty

public LinguisticProperty(java.lang.Object key,
                          LinguisticProperty.PropStatus propStatus,
                          java.lang.Object value)
Parameters:
key - the key for the Property; should be unique
propStatus - the status of the property
value - the associated value (e.g. a TmxProp)
Method Detail

fromJson

public static LinguisticProperty fromJson(java.lang.String linguisticProperty)
fromJson

Parameters:
value2 -
Returns:

bCompare

public boolean bCompare(LinguisticProperties compLingProps)
bCompare check if this LinguisticProperty exists in compLingProps; if yes, return true, otherwise false

Parameters:
compLingProps - a set of LinguisticProperty (LinguisticProperties)
Returns:
true if contained otherwise false

bCompare

public boolean bCompare(LinguisticProperty compLingProp)
bCompare compare against a LinguisticProperty; the key and the value are "stringified"

Parameters:
compLingProp - the LinguisticProperty to compare against
Returns:
true if the property matches, otherwise false

format

public java.lang.String format()
format

Returns:
a formatted version of the linguistic property

getData

public java.lang.Object getData()
Returns:
the data

getKey

public java.lang.Object getKey()
Returns:
the key

getPropStatus

public LinguisticProperty.PropStatus getPropStatus()
Returns:
the propStatus

getPropType

public LinguisticProperty.PropType getPropType()
Returns:
the propType

getValue

public java.lang.Object getValue()
Returns:
the value

mapToJson

public java.lang.String mapToJson()
mapToJson

Returns:

setData

public void setData(java.lang.Object data)
Parameters:
data - the data to set

setKey

public void setKey(java.lang.Object key)
Parameters:
key - the key to set

setPropStatus

public void setPropStatus(LinguisticProperty.PropStatus propStatus)
Parameters:
propStatus - the propStatus to set

setPropType

public void setPropType(LinguisticProperty.PropType propType)
Parameters:
propType - the propType to set

setValue

public void setValue(java.lang.Object value)
Parameters:
value - the value to set