use of org.openforis.idm.metamodel.LanguageSpecificText in project collect by openforis.
the class CodeListLine method addLocalizedText.
private void addLocalizedText(Map<Integer, List<LanguageSpecificText>> levelToLocalizedTexts, int levelIdx, String lang, String label) {
List<LanguageSpecificText> labelItems = levelToLocalizedTexts.get(levelIdx);
LanguageSpecificText item = new LanguageSpecificText(lang, label);
if (labelItems == null) {
labelItems = new ArrayList<LanguageSpecificText>();
levelToLocalizedTexts.put(levelIdx, labelItems);
}
labelItems.add(item);
}
use of org.openforis.idm.metamodel.LanguageSpecificText in project collect by openforis.
the class LanguageSpecificTextXS method marshal.
protected void marshal(List<? extends LanguageSpecificText> txts, String defaultLanguage) throws IOException {
if (txts == null || txts.isEmpty()) {
super.marshal(txts);
} else {
startList();
for (LanguageSpecificText txt : txts) {
// do not include default language in marshalled XML
boolean includeLang = txt.getLanguage() != null && !txt.getLanguage().equals(defaultLanguage);
marshal(txt, includeLang);
}
endList();
}
}
Aggregations