LOG.debug("{} => {}", description.getName(), gson.toJson(spec, BatchSpec.class));
}
}
private BatchSpec toSpec(Class<? extends BatchDescription> description) {
Batch info = description.getAnnotation(Batch.class);
String batchId = getEnvironment().getConfiguration().getBatchId();
if (info == null) {
LOG.warn(MessageFormat.format(
"Failed to extract \"@{0}\": {1}",
Batch.class.getName(),
description.getName()));
return new BatchSpec(batchId);
} else {
String comment = normalizeComment(info.comment());
boolean strict = info.strict();
List<Parameter> parameters = toParameters(description, info.parameters());
return new BatchSpec(info.name(), comment, strict, parameters);
}
}