TypeChooser (final Type type) { final TypeChooser typeChooser = myClassChoosers.get(type); return typeChooser != null ? typeChooser : new TypeChooser() { @Override public Type chooseType(final XmlTag tag) { return type; } @Override public void distinguishTag(final XmlTag tag, final Type aClass) { } @Override public Type[] getChooserTypes() { return new Type[]{type}; } }; }