| from validators.base import Validator | |
| from validators.code_verifier import CodeVerifier | |
| from validators.physics_validator import PhysicsValidator | |
| from validators.test_generator import TestGenerator | |
| from validators.dependency_resolver import DependencyResolver | |
| from validators.design_implementation_validator import DesignImplementationValidator | |
| class ValidatorFactory: | |
| """検証クラスファクトリ""" | |
| def __init__(self, client): | |
| self.client = client | |
| self.validators = {} | |
| def get_validator(self, validator_type): | |
| """指定タイプの検証クラスのインスタンスを取得""" | |
| if validator_type not in self.validators: | |
| if validator_type == "code": | |
| self.validators[validator_type] = CodeVerifier(self.client) | |
| elif validator_type == "physics": | |
| self.validators[validator_type] = PhysicsValidator(self.client) | |
| elif validator_type == "test": | |
| self.validators[validator_type] = TestGenerator(self.client) | |
| elif validator_type == "dependency": | |
| self.validators[validator_type] = DependencyResolver(self.client) | |
| elif validator_type == "design": | |
| self.validators[validator_type] = DesignImplementationValidator(self.client) | |
| else: | |
| raise ValueError(f"Unknown validator type: {validator_type}") | |
| return self.validators[validator_type] |