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

JavaJaxRS.resteasy.eap.RestApplication.mustache Maven / Gradle / Ivy

There is a newer version: 7.8.0
Show newest version
package {{invokerPackage}};

import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;

import java.util.Set;
import java.util.HashSet;
{{#useSwaggerFeature}}
import io.swagger.jaxrs.config.BeanConfig;
{{/useSwaggerFeature}}

{{#apiInfo}}
{{#apis}}
import {{package}}.impl.{{classname}}ServiceImpl;
{{/apis}}
{{/apiInfo}}   

@ApplicationPath("/")
public class RestApplication extends Application {

{{#useSwaggerFeature}}
    public RestApplication() {
        super();
        // Customize the dynamic contract
        BeanConfig beanConfig = new BeanConfig();
        beanConfig.setTitle("{{appName}}");
        beanConfig.setVersion("{{version}}");
        beanConfig.setSchemes(new String[] { "{{scheme}}" });
        beanConfig.setHost("{{host}}");
        beanConfig.setBasePath("{{basePathWithoutHost}}");
        beanConfig.setResourcePackage("{{invokerPackage}}");
        beanConfig.setScan(true);

    }
{{/useSwaggerFeature}}

    public Set> getClasses() {
        Set> resources = new HashSet>();
{{#apiInfo}}
{{#apis}}
        resources.add({{classname}}ServiceImpl.class);
{{/apis}}
{{/apiInfo}}        

{{#useSwaggerFeature}}      
        resources.add(io.swagger.jaxrs.listing.ApiListingResource.class);
        resources.add(io.swagger.jaxrs.listing.SwaggerSerializers.class);
{{/useSwaggerFeature}}       
        return resources;
    }




}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy