add @Generated to all Java class templates

This commit is contained in:
russellb337 2015-08-11 12:42:18 -07:00
parent 6fbb8ab1e0
commit 38fccbd73d
10 changed files with 10 additions and 0 deletions

View File

@ -30,6 +30,7 @@ import static org.springframework.http.MediaType.*;
@Controller @Controller
@RequestMapping(value = "/{{baseName}}", produces = {APPLICATION_JSON_VALUE}) @RequestMapping(value = "/{{baseName}}", produces = {APPLICATION_JSON_VALUE})
@Api(value = "/{{baseName}}", description = "the {{baseName}} API") @Api(value = "/{{baseName}}", description = "the {{baseName}} API")
{{>generatedAnnotation}}
{{#operations}} {{#operations}}
public class {{classname}} { public class {{classname}} {
{{#operation}} {{#operation}}

View File

@ -1,5 +1,6 @@
package {{apiPackage}}; package {{apiPackage}};
{{>generatedAnnotation}}
public class ApiException extends Exception{ public class ApiException extends Exception{
private int code; private int code;
public ApiException (int code, String msg) { public ApiException (int code, String msg) {

View File

@ -5,6 +5,7 @@ import java.io.IOException;
import javax.servlet.*; import javax.servlet.*;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
{{>generatedAnnotation}}
public class ApiOriginFilter implements javax.servlet.Filter { public class ApiOriginFilter implements javax.servlet.Filter {
@Override @Override
public void doFilter(ServletRequest request, ServletResponse response, public void doFilter(ServletRequest request, ServletResponse response,

View File

@ -3,6 +3,7 @@ package {{apiPackage}};
import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlTransient;
@javax.xml.bind.annotation.XmlRootElement @javax.xml.bind.annotation.XmlRootElement
{{>generatedAnnotation}}
public class ApiResponseMessage { public class ApiResponseMessage {
public static final int ERROR = 1; public static final int ERROR = 1;
public static final int WARNING = 2; public static final int WARNING = 2;

View File

@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* {{description}} * {{description}}
**/{{/description}} **/{{/description}}
@ApiModel(description = "{{{description}}}") @ApiModel(description = "{{{description}}}")
{{>generatedAnnotation}}
public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} { public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {
{{#vars}}{{#isEnum}} {{#vars}}{{#isEnum}}
public enum {{datatypeWithEnum}} { public enum {{datatypeWithEnum}} {

View File

@ -1,5 +1,6 @@
package {{apiPackage}}; package {{apiPackage}};
{{>generatedAnnotation}}
public class NotFoundException extends ApiException { public class NotFoundException extends ApiException {
private int code; private int code;
public NotFoundException (int code, String msg) { public NotFoundException (int code, String msg) {

View File

@ -18,6 +18,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
@EnableSwagger2 //Loads the spring beans required by the framework @EnableSwagger2 //Loads the spring beans required by the framework
@PropertySource("classpath:swagger.properties") @PropertySource("classpath:swagger.properties")
@Import(SwaggerUiConfiguration.class) @Import(SwaggerUiConfiguration.class)
{{>generatedAnnotation}}
public class SwaggerConfig { public class SwaggerConfig {
@Bean @Bean
ApiInfo apiInfo() { ApiInfo apiInfo() {

View File

@ -8,6 +8,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
@Configuration @Configuration
@EnableWebMvc @EnableWebMvc
{{>generatedAnnotation}}
public class SwaggerUiConfiguration extends WebMvcConfigurerAdapter { public class SwaggerUiConfiguration extends WebMvcConfigurerAdapter {
private static final String[] SERVLET_RESOURCE_LOCATIONS = { "/" }; private static final String[] SERVLET_RESOURCE_LOCATIONS = { "/" };

View File

@ -2,6 +2,7 @@ package {{configPackage}};
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
{{>generatedAnnotation}}
public class WebApplication extends AbstractAnnotationConfigDispatcherServletInitializer { public class WebApplication extends AbstractAnnotationConfigDispatcherServletInitializer {
@Override @Override

View File

@ -3,6 +3,7 @@ package {{configPackage}};
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer; import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
{{>generatedAnnotation}}
public class WebMvcConfiguration extends WebMvcConfigurationSupport { public class WebMvcConfiguration extends WebMvcConfigurationSupport {
@Override @Override
public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) { public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {