private DeckValidatorFactory() {}
public DeckValidator createDeckValidator(String deckType) {
DeckValidator validator;
Constructor<?> con;
try {
con = deckTypes.get(deckType).getConstructor(new Class[]{});
validator = (DeckValidator)con.newInstance(new Object[] {});
} catch (Exception ex) {
logger.fatal("DeckValidatorFactory error", ex);
return null;
}
logger.debug("Deck validator created: " + validator.getName());
return validator;
}