public static FolderXmlViewGenerator getInstance(FolderGenerators type) throws Folder2XmlException {
        FolderXmlViewGenerator parser;
        switch (type) {
            case DOM_FOLDER_GENERATOR:
                parser = new DOMGenerator();
                break;
            case SAX_FOLDER_GENERATOR:
                parser = new SAXGenerator();
                break;
            case JAXB_FOLDER_GENERATOR:
                parser = new JAXBGenerator();
                break;
            case XSTREAM_FOLDER_GENERATOR:
                parser = new XStreamGenerator();
                break;
            default:
                throw new Folder2XmlException();
        }
        return parser;
    }