see http://www.javaworld.com/javaworld/javatips/jw-javatip122.html
Object readResolve() { return nameToTypeMap[name] as Object; }