final DescriptionImpl description) {
Assert.notNull(transaction, "Annotation cannot be null.");
Assert.hasText(beanName, "Bean name cannot be empty.");
Assert.notNull(description, "Description cannot be null.");
final TransactionParameters transactionParameters = new TransactionParameters();
final RequiredTransaction requiredTransaction;
switch (transaction.value()) {
case NONE:
requiredTransaction = RequiredTransaction.none;
break;
default:
// Fall through
case REQUIRED:
requiredTransaction = RequiredTransaction.required;
break;
case REQUIRES_NEW:
requiredTransaction = RequiredTransaction.requiresnew;
break;
}
transactionParameters.setRequired(requiredTransaction);
if (transaction.readOnly()) {
transactionParameters.setCapability(TransactionCapability.readonly);
} else {
transactionParameters.setCapability(TransactionCapability.readwrite);
}
transactionParameters.setBufferSize(transaction.bufferSize());
description.setRequiredTransactionParameters(transactionParameters);
}