use of org.openlca.ilcd.commons.LangString in project olca-modules by GreenDelta.
the class ContentElement method write.
void write(Element elem) {
if (elem == null)
return;
for (LangString n : name) {
Element e = Dom.addChild(elem, "epd2:name", Vocab.NS_EPDv2);
Dom.setLangString(e, n);
}
if (massPerc != null) {
Element e = Dom.addChild(elem, "epd2:weightPerc", Vocab.NS_EPDv2);
massPerc.write(e);
}
if (mass != null) {
Element e = Dom.addChild(elem, "epd2:mass", Vocab.NS_EPDv2);
mass.write(e);
}
for (LangString c : comment) {
Element e = Dom.addChild(elem, "epd2:comment", Vocab.NS_EPDv2);
Dom.setLangString(e, c);
}
}
use of org.openlca.ilcd.commons.LangString in project olca-modules by GreenDelta.
the class SafetyMargins method clone.
@Override
public SafetyMargins clone() {
SafetyMargins clone = new SafetyMargins();
clone.margins = margins;
for (LangString d : description) {
if (d != null)
clone.description.add(d.clone());
}
return clone;
}
use of org.openlca.ilcd.commons.LangString in project olca-modules by GreenDelta.
the class IO method getName.
@SuppressWarnings("unchecked")
private static String getName(Model m) {
ModelName mn = Models.getModelName(m);
if (mn == null)
return "";
List<?>[] parts = new List<?>[] { mn.name, mn.technicalDetails, mn.mixAndLocation, mn.flowProperties };
String name = "";
for (List<?> part : parts) {
String s = LangString.getFirst((List<LangString>) part, "en");
if (Strings.nullOrEmpty(s))
continue;
if (name.length() > 0)
name += "; ";
name += s.trim();
}
return name;
}
Aggregations