br.com.anteros.jsondoc.springmvc.scanner.builder.SpringResponseStatusBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Anteros-JSONDoc-SpringMVC Show documentation
Show all versions of Anteros-JSONDoc-SpringMVC Show documentation
The support for Spring MVC of the jsondoc project.
The newest version!
package br.com.anteros.jsondoc.springmvc.scanner.builder;
import java.lang.reflect.Method;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
public class SpringResponseStatusBuilder {
public static String buildResponseStatusCode(Method method) {
if (method.isAnnotationPresent(ResponseStatus.class)) {
ResponseStatus responseStatus = method.getAnnotation(ResponseStatus.class);
return responseStatus.value().toString() + " - " + responseStatus.value().getReasonPhrase();
} else {
return HttpStatus.OK.toString() + " - " + "OK";
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy