#include "project/SourceGroupFactoryModuleJava.h" #include "project/SourceGroupJavaEmpty.h" #include "project/SourceGroupJavaGradle.h" #include "project/SourceGroupJavaMaven.h" #include "settings/SourceGroupSettingsJavaEmpty.h" #include "settings/SourceGroupSettingsJavaGradle.h" #include "settings/SourceGroupSettingsJavaMaven.h" SourceGroupFactoryModuleJava::~SourceGroupFactoryModuleJava() { } bool SourceGroupFactoryModuleJava::supports(SourceGroupType type) const { switch (type) { case SOURCE_GROUP_JAVA_EMPTY: case SOURCE_GROUP_JAVA_GRADLE: case SOURCE_GROUP_JAVA_MAVEN: return true; default: break; } return false; } std::shared_ptr SourceGroupFactoryModuleJava::createSourceGroup(std::shared_ptr settings) { std::shared_ptr sourceGroup; if (std::shared_ptr javaSettings = std::dynamic_pointer_cast(settings)) { sourceGroup = std::shared_ptr(new SourceGroupJavaEmpty(javaSettings)); } else if (std::shared_ptr javaSettings = std::dynamic_pointer_cast(settings)) { sourceGroup = std::shared_ptr(new SourceGroupJavaGradle(javaSettings)); } else if (std::shared_ptr javaSettings = std::dynamic_pointer_cast(settings)) { sourceGroup = std::shared_ptr(new SourceGroupJavaMaven(javaSettings)); } return sourceGroup; }