Search in sources :

Example 1 with ResourceHandler

use of org.raml.jaxrs.generator.v10.ResourceHandler in project raml-for-jax-rs by mulesoft-labs.

the class RamlScanner method handle.

public void handle(org.raml.v2.api.model.v10.api.Api api) throws IOException {
    CurrentBuild build = new CurrentBuild(api, ExtensionManager.createExtensionManager());
    configuration.setupBuild(build);
    build.constructClasses(new V10Finder(build, api));
    ResourceHandler resourceHandler = new ResourceHandler(build);
    // handle resources.
    for (Resource resource : api.resources()) {
        resourceHandler.handle(resource);
    }
    build.generate(configuration.getOutputDirectory());
}
Also used : Resource(org.raml.v2.api.model.v10.resources.Resource) ResourceHandler(org.raml.jaxrs.generator.v10.ResourceHandler) V10Finder(org.raml.jaxrs.generator.v10.V10Finder)

Example 2 with ResourceHandler

use of org.raml.jaxrs.generator.v10.ResourceHandler in project raml-for-jax-rs by mulesoft-labs.

the class RamlScanner method handle.

public void handle(org.raml.v2.api.model.v08.api.Api api) throws IOException {
    GAbstractionFactory factory = new GAbstractionFactory();
    V08TypeRegistry registry = new V08TypeRegistry();
    V08Finder typeFinder = new V08Finder(api, factory, registry);
    CurrentBuild build = new CurrentBuild(null, ExtensionManager.createExtensionManager());
    configuration.setupBuild(build);
    build.constructClasses(typeFinder);
    ResourceHandler resourceHandler = new ResourceHandler(build);
    // handle resources.
    for (org.raml.v2.api.model.v08.resources.Resource resource : api.resources()) {
        resourceHandler.handle(typeFinder.globalSchemas().keySet(), registry, resource);
    }
    build.generate(configuration.getOutputDirectory());
}
Also used : V08Finder(org.raml.jaxrs.generator.v08.V08Finder) V08TypeRegistry(org.raml.jaxrs.generator.v08.V08TypeRegistry) ResourceHandler(org.raml.jaxrs.generator.v10.ResourceHandler)

Aggregations

ResourceHandler (org.raml.jaxrs.generator.v10.ResourceHandler)2 V08Finder (org.raml.jaxrs.generator.v08.V08Finder)1 V08TypeRegistry (org.raml.jaxrs.generator.v08.V08TypeRegistry)1 V10Finder (org.raml.jaxrs.generator.v10.V10Finder)1 Resource (org.raml.v2.api.model.v10.resources.Resource)1