Package net.sf.okapi.common.resource
Class Property
- java.lang.Object
-
- net.sf.okapi.common.resource.Property
-
- All Implemented Interfaces:
Cloneable
public class Property extends Object implements Cloneable
Represents a read-only or a modifiable property associated with a resource. For example the HREF attribute of the element A in HTML would be a property. Note that translatable data (such as the text of an attribute ALT of an IMG element in HTML) must be stored inTextUnitrather that Property.
-
-
Field Summary
Fields Modifier and Type Field Description static StringAPPROVEDstatic StringCOORDINATESstatic StringENCODINGstatic StringITS_LQIHelper property used only for placing back some ITS and other annotations.static StringITS_MTCONFIDENCEstatic StringITS_PROVstatic StringLANGUAGEstatic StringMAX_HEIGHTstatic StringMAX_WIDTHSizing properties, can be applied to StartGroup or ITextUnit objects.static StringSIZE_UNITstatic StringSTATEstatic StringSTATE_QUALIFIERstatic StringTMX_histatic StringTMX_iFor TMX filter - may be used byTMXWriterorTMXFilterWriterstatic StringTMX_xstatic StringXLIFF_PHASEstatic StringXLIFF_TOOL
-
Constructor Summary
Constructors Constructor Description Property()Property(String name, String value)Creates a new read-only property object with a name and a value.Property(String name, String value, boolean isReadOnly)Creates a new property object with a name, a vale and its read-only flag.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Propertyclone()Clones this property.booleangetBoolean()Gets the boolean value of this property.StringgetName()Gets the name of this property.StringgetValue()Gets the value of this property.booleanisReadOnly()Indicates if this property is read-only.protected voidsetName(String name)protected voidsetReadOnly(boolean isReadOnly)voidsetValue(String value)Sets a new value for this property.StringtoString()Gets the string representation of this property.
-
-
-
Field Detail
-
ENCODING
public static final String ENCODING
- See Also:
- Constant Field Values
-
LANGUAGE
public static final String LANGUAGE
- See Also:
- Constant Field Values
-
APPROVED
public static final String APPROVED
- See Also:
- Constant Field Values
-
COORDINATES
public static final String COORDINATES
- See Also:
- Constant Field Values
-
STATE_QUALIFIER
public static final String STATE_QUALIFIER
- See Also:
- Constant Field Values
-
STATE
public static final String STATE
- See Also:
- Constant Field Values
-
ITS_LQI
public static final String ITS_LQI
Helper property used only for placing back some ITS and other annotations.- See Also:
- Constant Field Values
-
ITS_PROV
public static final String ITS_PROV
- See Also:
- Constant Field Values
-
ITS_MTCONFIDENCE
public static final String ITS_MTCONFIDENCE
- See Also:
- Constant Field Values
-
XLIFF_TOOL
public static final String XLIFF_TOOL
- See Also:
- Constant Field Values
-
XLIFF_PHASE
public static final String XLIFF_PHASE
- See Also:
- Constant Field Values
-
MAX_WIDTH
public static final String MAX_WIDTH
Sizing properties, can be applied to StartGroup or ITextUnit objects.- See Also:
- Constant Field Values
-
MAX_HEIGHT
public static final String MAX_HEIGHT
- See Also:
- Constant Field Values
-
SIZE_UNIT
public static final String SIZE_UNIT
- See Also:
- Constant Field Values
-
TMX_i
public static final String TMX_i
For TMX filter - may be used byTMXWriterorTMXFilterWriter- See Also:
- Constant Field Values
-
TMX_hi
public static String TMX_hi
-
TMX_x
public static String TMX_x
-
-
Constructor Detail
-
Property
public Property()
-
Property
public Property(String name, String value, boolean isReadOnly)
Creates a new property object with a name, a vale and its read-only flag.- Parameters:
name- the name of the property (case-sensitive).value- the value of the property.isReadOnly- true if the property cannot be modified using the filter, false if you can modify the value in the output document.
-
-
Method Detail
-
toString
public String toString()
Gets the string representation of this property. This is the same as its value.
-
clone
public Property clone()
Clones this property.
-
getName
public String getName()
Gets the name of this property.- Returns:
- the name of this property.
-
getValue
public String getValue()
Gets the value of this property.- Returns:
- the value of this property.
-
getBoolean
public boolean getBoolean()
Gets the boolean value of this property. Use this helper method to get a boolean from the value of this property. The values "true" and "yes" (in any case) returns true, any other value returns false. No verification is done to see if the value is really boolean or not.- Returns:
- true is the property value is "true", "yes" (case-insensitive), false otherwise.
-
setValue
public void setValue(String value)
Sets a new value for this property.- Parameters:
value- the new value to set.
-
isReadOnly
public boolean isReadOnly()
Indicates if this property is read-only.All property can be changed, but the ones flagged as read-only cannot be modified when re-writing the document from where they have been extracted.
- Returns:
- true if the property cannot be modified in the filter output, false if it can be modified.
-
setName
protected void setName(String name)
-
setReadOnly
protected void setReadOnly(boolean isReadOnly)
-
-