All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.stanford.protege.webprotege.lang.DefaultDisplayNameSettingsFactory Maven / Gradle / Ivy

The newest version!
package edu.stanford.protege.webprotege.lang;

import com.google.common.collect.ImmutableList;
import edu.stanford.protege.webprotege.common.DictionaryLanguage;

import javax.annotation.Nonnull;
import javax.inject.Inject;

/**
 * Matthew Horridge
 * Stanford Center for Biomedical Informatics Research
 * 5 Sep 2018
 */
public class DefaultDisplayNameSettingsFactory {

    @Inject
    public DefaultDisplayNameSettingsFactory() {
    }

    @Nonnull
    public DisplayNameSettings getDefaultDisplayNameSettings(@Nonnull String langTag) {
        ImmutableList primaryLanguages;
        if (langTag.isEmpty()) {
            primaryLanguages = ImmutableList.of(DictionaryLanguage.rdfsLabel(langTag),
                                                DictionaryLanguage.prefixedName(),
                                                DictionaryLanguage.localName());
        }
        else {
            primaryLanguages = ImmutableList.of(DictionaryLanguage.rdfsLabel(langTag),
                                                DictionaryLanguage.rdfsLabel(""),
                                                DictionaryLanguage.prefixedName(),
                                                DictionaryLanguage.localName());
        }
        return DisplayNameSettings.get(
                primaryLanguages,
                ImmutableList.of()
        );
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy