class TypeAliasRegistry {

    @SuppressWarnings("unchecked")
    // throws class cast exception as well if types cannot be assigned
    public <T> Class<T> resolveAlias(String string) {
        try {
            if (string == null) {
                return null;
            }
            // issue #748
            // key = 全类名小写(string)
            String key = string.toLowerCase(Locale.ENGLISH);
            Class<T> value;
            if (typeAliases.containsKey(key)) {
                // 别名 map 中是否有
                value = (Class<T>) typeAliases.get(key);
            }
            else {
                // 没有构造一个
                value = (Class<T>) Resources.classForName(string);
            }
            return value;
        }
        catch (ClassNotFoundException e) {
            throw new TypeException("Could not resolve type alias '" + string + "'.  Cause: " + e, e);
        }
    }

    public  TypeAliasRegistry();

}