kawigi.language
Class LanguageFactory

java.lang.Object
  extended by kawigi.language.LanguageFactory

public class LanguageFactory
extends java.lang.Object

Creates EditorLanguage objects based on a language name or filetype. This class was really simple at some point in time and returned TopCoder languages. Then I wanted to associate more data with languages, so I subclassed all the TopCoder languages and made this class return those. Then I wanted the template code generated by those subclassed languages to be customizable by allowing the user to indirectly write their own subclass of my subclassed languages, and this class became this gigantic monstrosity of dynamic class-loading. Then I wanted to make it so that KawigiEdit could be run standalone without having the TopCoder classes in the classpath, and this class was made simple again, just returning elements from my EditorLanguage enum. Actually, the only remaining use of this class is to figure out which language to use to render code opened in the Local Code tab, which probably means it's not worth this long comment. It isn't even used to map TC languages to KawigiEdit EditorLanguages, because that would require linking to TopCoder classes, and this class needs to be usable in standalone mode.


Constructor Summary
LanguageFactory()
           
 
Method Summary
static EditorLanguage getLanguage(java.lang.String name)
          Returns the EditorLanguage with the given name, or that supports the file extension given by name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LanguageFactory

public LanguageFactory()
Method Detail

getLanguage

public static EditorLanguage getLanguage(java.lang.String name)
Returns the EditorLanguage with the given name, or that supports the file extension given by name.