Class LangString
java.lang.Object
dev.jcputney.elearning.parser.input.lom.types.LangString
- All Implemented Interfaces:
Serializable
Represents a LangString in LOM metadata, which is a collection of strings with language
attributes. This type is used for fields such as title, description, and keyword.
<xs:complexType name="LangString">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="string" type="langString"/>
<xs:group ref="ex:customElements"/>
</xs:choice>
</xs:complexType>
<xs:complexType name="langString">
<xs:simpleContent>
<xs:extension base="CharacterString">
<xs:attribute name="language" type="LanguageId"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for theLangStringclass.LangString(String value) Constructs aLangStringobject with a specified value.LangString(String language, String value) Constructs aLangStringobject with a specified language and value. -
Method Summary
Modifier and TypeMethodDescriptionbooleanRetrieves the language associated with this instance.getValue()Retrieves the value of the string associated with this instance.inthashCode()voidsetLanguage(String language) Sets the language attribute of this instance.voidSets the value of this instance.toString()
-
Constructor Details
-
LangString
Constructs aLangStringobject with a specified language and value.- Parameters:
language- the language code for the string, generally using ISO 639-1 or ISO 639-3 codesvalue- the value of the string in the specified language
-
LangString
Constructs aLangStringobject with a specified value.- Parameters:
value- the value of the string; typically representing text in a specific language
-
LangString
public LangString()Default constructor for theLangStringclass. Constructs an instance of theLangStringclass without initializing the language or value fields. This constructor is primarily provided for use cases requiring an object without any preset state.
-
-
Method Details
-
getLanguage
Retrieves the language associated with this instance.- Returns:
- the language as a String
-
setLanguage
Sets the language attribute of this instance.- Parameters:
language- the language code to set, typically represented as an ISO 639-1 or ISO 639-3 code
-
getValue
Retrieves the value of the string associated with this instance.- Returns:
- the value as a String
-
setValue
Sets the value of this instance.- Parameters:
value- the string value to set; trimmed of leading whitespaces while preserving indentation
-
toString
-
equals
-
hashCode
public int hashCode()
-