package grammar.output;
import grammar.analysis.NounSuffixNounClassCorrelator;
import grammar.model.Language;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class ApplicationPluginManager {
private static Map<Language, ApplicationPluginManager> INSTANCE =
new HashMap<Language, ApplicationPluginManager>();
private final List<ApplicationPlugin> plugins =
new ArrayList<ApplicationPlugin>();
private ApplicationPluginManager(Language language) {
// plugins.add(new ModelVerbGraphViewer()); // TODO factor out as plugin
plugins.add(new NounSuffixNounClassCorrelator(language)); // also factor out
}
public static ApplicationPluginManager getInstance(Language language) {
ApplicationPluginManager apm;
if ((apm = INSTANCE.get(language)) == null)
INSTANCE.put(language, apm = new ApplicationPluginManager(language));
return apm;
}
public void register(ApplicationPlugin plugin) {
plugins.add(plugin);
}
public List<ApplicationPlugin> getPlugins() {
return Collections.unmodifiableList(plugins);
}
}