Hello Daniel, Am 16.09.2012 um 17:23 schrieb Daniel Naber:
>> Instead of scanning for subclasses, I'd suggest to define some location >> in META-INF where language modules can declare themselves. E.g. a file >> META-INF/org/languagetool/language-module.properties with a key/value >> like "languageClass=org.languagetool.language.en.English". > > So there are several files of the same name in the classpath? But > getResourceAsStream() will only return one. Or do you think is a a good use > case for a ServiceLoader? > http://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html I'm afraid, I have no experience with the ServiceLoader, but it seems to be suitable. There is a ClassLoader method which returns all the files of a certain name in the classpath: http://docs.oracle.com/javase/6/docs/api/java/lang/ClassLoader.html#findResources(java.lang.String) Cheers, -- Richard ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://ad.doubleclick.net/clk;258768047;13503038;j? http://info.appdynamics.com/FreeJavaPerformanceDownload.html _______________________________________________ Languagetool-devel mailing list Languagetool-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/languagetool-devel