use of org.jabref.logic.importer.fileformat.mods.LanguageTermDefinition in project jabref by JabRef.
the class ModsExportFormat method addLanguage.
private void addLanguage(ModsDefinition mods, String value) {
LanguageDefinition language = new LanguageDefinition();
LanguageTermDefinition languageTerm = new LanguageTermDefinition();
languageTerm.setValue(value);
language.getLanguageTerm().add(languageTerm);
mods.getModsGroup().add(language);
}
use of org.jabref.logic.importer.fileformat.mods.LanguageTermDefinition in project jabref by JabRef.
the class ModsImporter method parseRecordInfo.
private void parseRecordInfo(Map<String, String> fields, RecordInfoDefinition recordInfo) {
List<JAXBElement<?>> recordContent = recordInfo.getRecordContentSourceOrRecordCreationDateOrRecordChangeDate();
for (JAXBElement<?> jaxbElement : recordContent) {
Object value = jaxbElement.getValue();
if (value instanceof StringPlusLanguagePlusAuthority) {
StringPlusLanguagePlusAuthority source = (StringPlusLanguagePlusAuthority) value;
putIfValueNotNull(fields, "source", source.getValue());
} else if (value instanceof LanguageDefinition) {
LanguageDefinition language = (LanguageDefinition) value;
List<LanguageTermDefinition> languageTerms = language.getLanguageTerm();
List<String> languages = languageTerms.stream().map(LanguageTermDefinition::getValue).collect(Collectors.toList());
putIfListIsNotEmpty(fields, languages, FieldName.LANGUAGE, ", ");
}
}
}
Aggregations