Package org.mycore.datamodel.language
Class MCRLanguageXML
java.lang.Object
org.mycore.datamodel.language.MCRLanguageXML
Helper class to map xml:lang and lang attributes in XML to MCRLanguage
- Author:
- Frank Lützenkirchen
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic MCRLanguage
getLanguage
(Element element) Returns the language of the given XML element, by inspecting the xml:lang or lang attribute.static void
setLangAttribute
(MCRLanguage lang, Element element) Sets the lang attribute to the ISO 639-2 bibliographic code of the given languagestatic void
setXMLLangAttribute
(MCRLanguage lang, Element element) Sets the xml:lang attribute to the ISO 639-1 code of the given language
-
Constructor Details
-
MCRLanguageXML
public MCRLanguageXML()
-
-
Method Details
-
setLangAttribute
Sets the lang attribute to the ISO 639-2 bibliographic code of the given language -
setXMLLangAttribute
Sets the xml:lang attribute to the ISO 639-1 code of the given language -
getLanguage
Returns the language of the given XML element, by inspecting the xml:lang or lang attribute. If neither exists, the default language is returned.
-