Package net.sf.okapi.lib.xliff2.core
Class StartXliffData
- java.lang.Object
-
- net.sf.okapi.lib.xliff2.core.DataWithExtAttributes
-
- net.sf.okapi.lib.xliff2.core.StartXliffData
-
- All Implemented Interfaces:
IWithExtAttributes
public class StartXliffData extends DataWithExtAttributes
Represents the information associated with an <xliff> element.
-
-
Constructor Summary
Constructors Constructor Description StartXliffData(String version)Creates aStartXliffDataobject.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Indicates if this object is equals to a given one.StringgetSourceLanguage()Gets the language code of the source for this document.StringgetTargetLanguage()Gets the target language of the document.StringgetVersion()Gets the version of this document.inthashCode()voidsetNamespace(String prefix, String namespaceURI)Sets a namespace declaration for this document.voidsetSourceLanguage(String sourceLang)Sets the source language of the document.voidsetTargetLanguage(String targetLang)Sets the target language for this document.-
Methods inherited from class net.sf.okapi.lib.xliff2.core.DataWithExtAttributes
getExtAttributes, getExtAttributeValue, hasExtAttribute, setExtAttributes
-
-
-
-
Constructor Detail
-
StartXliffData
public StartXliffData(String version)
Creates aStartXliffDataobject.- Parameters:
version- the version of the XLIFF document, use null to get the default.
-
-
Method Detail
-
getVersion
public String getVersion()
Gets the version of this document.- Returns:
- the version of this document.
-
getSourceLanguage
public String getSourceLanguage()
Gets the language code of the source for this document.- Returns:
- the language code for the source.
-
setSourceLanguage
public void setSourceLanguage(String sourceLang)
Sets the source language of the document.- Parameters:
sourceLang- the source language to set (must not be null).- Throws:
InvalidParameterException- if the language code is invalid.
-
getTargetLanguage
public String getTargetLanguage()
Gets the target language of the document.- Returns:
- the target language of the document (can be null).
-
setTargetLanguage
public void setTargetLanguage(String targetLang)
Sets the target language for this document.- Parameters:
targetLang- the target language to set (can be null).- Throws:
InvalidParameterException- if the language code is invalid.
-
setNamespace
public void setNamespace(String prefix, String namespaceURI)
Sets a namespace declaration for this document.- Parameters:
prefix- the prefix to use for the namespace.namespaceURI- the namespace URI.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classDataWithExtAttributes
-
equals
public boolean equals(Object obj)
Description copied from class:DataWithExtAttributesIndicates if this object is equals to a given one.- Overrides:
equalsin classDataWithExtAttributes- Parameters:
obj- the other object to compare.- Returns:
- true if the two objects are identical.
-
-