Search in sources :

Example 1 with SubjectDefinition

use of org.jabref.logic.importer.fileformat.mods.SubjectDefinition in project jabref by JabRef.

the class ModsExportFormat method addKeyWords.

private void addKeyWords(ModsDefinition mods, String value) {
    String[] keywords = value.split(", ");
    for (String keyword : keywords) {
        SubjectDefinition subject = new SubjectDefinition();
        StringPlusLanguagePlusAuthority topic = new StringPlusLanguagePlusAuthority();
        topic.setValue(keyword);
        JAXBElement<?> element = new JAXBElement<>(new QName(MODS_NAMESPACE_URI, "topic"), StringPlusLanguagePlusAuthority.class, topic);
        subject.getTopicOrGeographicOrTemporal().add(element);
        mods.getModsGroup().add(subject);
    }
}
Also used : QName(javax.xml.namespace.QName) JAXBElement(javax.xml.bind.JAXBElement) StringPlusLanguagePlusAuthority(org.jabref.logic.importer.fileformat.mods.StringPlusLanguagePlusAuthority) SubjectDefinition(org.jabref.logic.importer.fileformat.mods.SubjectDefinition)

Aggregations

JAXBElement (javax.xml.bind.JAXBElement)1 QName (javax.xml.namespace.QName)1 StringPlusLanguagePlusAuthority (org.jabref.logic.importer.fileformat.mods.StringPlusLanguagePlusAuthority)1 SubjectDefinition (org.jabref.logic.importer.fileformat.mods.SubjectDefinition)1