All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pub.codex.apix.operation.OperationSummaryReader Maven / Gradle / Ivy

There is a newer version: 5.0.2
Show newest version
package pub.codex.apix.operation;

import com.google.common.base.Optional;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import pub.codex.apix.annotations.ApiOperation;
import pub.codex.apix.context.OperationContext;

@Component
@Order(Ordered.OperationSummaryReader)
public class OperationSummaryReader implements OperationBuilderPlugin {

    @Override
    public void apply(OperationContext context) {
        Optional apiOperationAnnotation = context.findAnnotation(ApiOperation.class);
        if (apiOperationAnnotation.isPresent() && StringUtils.hasText(apiOperationAnnotation.get().value())) {
            context.operationBuilder().setSummary(apiOperationAnnotation.get().describe());
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy