public static Class getVimClass()

in src/main/java/org/doublecloud/ws/util/TypeUtil.java [92:116]


    public static Class<?> getVimClass(String type) {
        if (VIM_CLASSES.containsKey(type)) {
            return VIM_CLASSES.get(type);
        }
        else {
            try {
                Class<?> clazz;
                if (!type.endsWith("[]")) {
                    clazz = Class.forName(PACKAGE_NAME + "." + type);
                }
                else {
                    String arrayType = type.substring(0, type.length() - 2);
                    clazz = Array.newInstance(getVimClass(arrayType), 0).getClass();
                }

                VIM_CLASSES.put(type, clazz);

                return clazz;
            }
            catch (ClassNotFoundException cnfe) {
                log.error("ClassNotFoundException caught for type: " + type, cnfe);
                return null;
            }
        }
    }