Search in sources :

Example 1 with V08TypeRegistry

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

the class RamlV08 method buildResourceV08.

public static void buildResourceV08(Object test, String raml, CodeContainer<TypeSpec> container, String name, String uri) throws IOException {
    Api api = buildApiV08(test, raml);
    V08TypeRegistry registry = new V08TypeRegistry();
    V08Finder typeFinder = new V08Finder(api, new GAbstractionFactory(), registry);
    CurrentBuild currentBuild = new CurrentBuild(null, ExtensionManager.createExtensionManager());
    currentBuild.constructClasses(typeFinder);
    ResourceBuilder builder = new ResourceBuilder(currentBuild, new V08GResource(new GAbstractionFactory(), api.resources().get(0), typeFinder.globalSchemas().keySet(), registry), name, uri);
    builder.output(container);
}
Also used : ResourceBuilder(org.raml.jaxrs.generator.builders.resources.ResourceBuilder) V08Finder(org.raml.jaxrs.generator.v08.V08Finder) CurrentBuild(org.raml.jaxrs.generator.CurrentBuild) V08GResource(org.raml.jaxrs.generator.v08.V08GResource) GAbstractionFactory(org.raml.jaxrs.generator.GAbstractionFactory) V08TypeRegistry(org.raml.jaxrs.generator.v08.V08TypeRegistry) Api(org.raml.v2.api.model.v08.api.Api)

Example 2 with V08TypeRegistry

use of org.raml.jaxrs.generator.v08.V08TypeRegistry 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

V08Finder (org.raml.jaxrs.generator.v08.V08Finder)2 V08TypeRegistry (org.raml.jaxrs.generator.v08.V08TypeRegistry)2 CurrentBuild (org.raml.jaxrs.generator.CurrentBuild)1 GAbstractionFactory (org.raml.jaxrs.generator.GAbstractionFactory)1 ResourceBuilder (org.raml.jaxrs.generator.builders.resources.ResourceBuilder)1 V08GResource (org.raml.jaxrs.generator.v08.V08GResource)1 ResourceHandler (org.raml.jaxrs.generator.v10.ResourceHandler)1 Api (org.raml.v2.api.model.v08.api.Api)1