Search in sources :

Example 1 with V10Finder

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

the class RamlV10 method buildResourceV10.

public static void buildResourceV10(Object test, String raml, CodeContainer<TypeSpec> container, String name, String uri) throws IOException {
    Api api = buildApiV10(test, raml);
    CurrentBuild currentBuild = new CurrentBuild(api, ExtensionManager.createExtensionManager());
    currentBuild.constructClasses(new V10Finder(null, api));
    ResourceBuilder builder = new ResourceBuilder(currentBuild, new V10GResource(currentBuild, new GAbstractionFactory(), api.resources().get(0)), name, uri);
    builder.output(container);
}
Also used : ResourceBuilder(org.raml.jaxrs.generator.builders.resources.ResourceBuilder) CurrentBuild(org.raml.jaxrs.generator.CurrentBuild) GAbstractionFactory(org.raml.jaxrs.generator.GAbstractionFactory) V10GResource(org.raml.jaxrs.generator.v10.V10GResource) Api(org.raml.v2.api.model.v10.api.Api) V10Finder(org.raml.jaxrs.generator.v10.V10Finder)

Example 2 with V10Finder

use of org.raml.jaxrs.generator.v10.V10Finder 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)

Aggregations

V10Finder (org.raml.jaxrs.generator.v10.V10Finder)2 CurrentBuild (org.raml.jaxrs.generator.CurrentBuild)1 GAbstractionFactory (org.raml.jaxrs.generator.GAbstractionFactory)1 ResourceBuilder (org.raml.jaxrs.generator.builders.resources.ResourceBuilder)1 ResourceHandler (org.raml.jaxrs.generator.v10.ResourceHandler)1 V10GResource (org.raml.jaxrs.generator.v10.V10GResource)1 Api (org.raml.v2.api.model.v10.api.Api)1 Resource (org.raml.v2.api.model.v10.resources.Resource)1