Search in sources :

Example 31 with Ds3SpecParserImpl

use of com.spectralogic.ds3autogen.Ds3SpecParserImpl in project ds3_autogen by SpectraLogic.

the class TestGeneratedComponentResponseCode method generateCode.

@Override
public void generateCode(final FileUtils fileUtils, final String inputFileName) throws IOException, TemplateModelException {
    final Ds3SpecParser parser = new Ds3SpecParserImpl();
    final Ds3ApiSpec spec = parser.getSpec(TestGeneratedCode.class.getResourceAsStream(inputFileName));
    final CodeGenerator codeGenerator = new JavaCodeGenerator();
    codeGenerator.generate(spec, fileUtils, Paths.get("."), new Ds3DocSpecEmptyImpl());
    requestGeneratedCode = new String(requestOutputStream.toByteArray());
    responseGeneratedCode = new String(responseOutputStream.toByteArray());
    responseParserGeneratedCode = new String(responseParserOutputStream.toByteArray());
    encapsulatingTypeGeneratedCode = new String(encapsulatingTypeOutputStream.toByteArray());
    ds3ClientGeneratedCode = new String(ds3ClientOutputStream.toByteArray());
    ds3ClientImplGeneratedCode = new String(ds3ClientImplOutputStream.toByteArray());
}
Also used : Ds3DocSpecEmptyImpl(com.spectralogic.ds3autogen.docspec.Ds3DocSpecEmptyImpl) Ds3SpecParserImpl(com.spectralogic.ds3autogen.Ds3SpecParserImpl) JavaCodeGenerator(com.spectralogic.ds3autogen.java.JavaCodeGenerator) JavaCodeGenerator(com.spectralogic.ds3autogen.java.JavaCodeGenerator) Ds3ApiSpec(com.spectralogic.ds3autogen.api.models.apispec.Ds3ApiSpec)

Example 32 with Ds3SpecParserImpl

use of com.spectralogic.ds3autogen.Ds3SpecParserImpl in project ds3_autogen by SpectraLogic.

the class TestGeneratedModelCode method generateCode.

public void generateCode(final FileUtils fileUtils, final String inputFileName) throws IOException, TemplateModelException {
    final Ds3SpecParser parser = new Ds3SpecParserImpl();
    final Ds3ApiSpec spec = parser.getSpec(TestGeneratedModelCode.class.getResourceAsStream(inputFileName));
    final CodeGenerator codeGenerator = new JavaCodeGenerator();
    codeGenerator.generate(spec, fileUtils, Paths.get("."), new Ds3DocSpecEmptyImpl());
    modelGeneratedCode = new String(modelOutputStream.toByteArray());
}
Also used : Ds3DocSpecEmptyImpl(com.spectralogic.ds3autogen.docspec.Ds3DocSpecEmptyImpl) Ds3SpecParserImpl(com.spectralogic.ds3autogen.Ds3SpecParserImpl) JavaCodeGenerator(com.spectralogic.ds3autogen.java.JavaCodeGenerator) JavaCodeGenerator(com.spectralogic.ds3autogen.java.JavaCodeGenerator) Ds3ApiSpec(com.spectralogic.ds3autogen.api.models.apispec.Ds3ApiSpec)

Example 33 with Ds3SpecParserImpl

use of com.spectralogic.ds3autogen.Ds3SpecParserImpl in project ds3_autogen by SpectraLogic.

the class TestGeneratedCode method generateCode.

public void generateCode(final FileUtils fileUtils, final String inputFileName, final Ds3DocSpec docSpec) throws IOException, TemplateModelException {
    final Ds3SpecParser parser = new Ds3SpecParserImpl();
    final Ds3ApiSpec spec = parser.getSpec(TestGeneratedCode.class.getResourceAsStream(inputFileName));
    final CodeGenerator codeGenerator = new JavaCodeGenerator();
    codeGenerator.generate(spec, fileUtils, Paths.get("."), docSpec);
    requestGeneratedCode = new String(requestOutputStream.toByteArray());
    responseGeneratedCode = new String(responseOutputStream.toByteArray());
    responseParserGeneratedCode = new String(responseParserOutputStream.toByteArray());
    ds3ClientGeneratedCode = new String(ds3ClientOutputStream.toByteArray());
    ds3ClientImplGeneratedCode = new String(ds3ClientImplOutputStream.toByteArray());
}
Also used : Ds3SpecParserImpl(com.spectralogic.ds3autogen.Ds3SpecParserImpl) JavaCodeGenerator(com.spectralogic.ds3autogen.java.JavaCodeGenerator) JavaCodeGenerator(com.spectralogic.ds3autogen.java.JavaCodeGenerator) Ds3ApiSpec(com.spectralogic.ds3autogen.api.models.apispec.Ds3ApiSpec)

Aggregations

Ds3SpecParserImpl (com.spectralogic.ds3autogen.Ds3SpecParserImpl)33 Ds3ApiSpec (com.spectralogic.ds3autogen.api.models.apispec.Ds3ApiSpec)33 Ds3SpecParser (com.spectralogic.ds3autogen.api.Ds3SpecParser)29 Ds3DocSpecEmptyImpl (com.spectralogic.ds3autogen.docspec.Ds3DocSpecEmptyImpl)26 Test (org.junit.Test)25 TestFileUtilsImpl (com.spectralogic.ds3autogen.utils.TestFileUtilsImpl)24 ByteArrayOutputStream (java.io.ByteArrayOutputStream)22 Enum (com.spectralogic.ds3autogen.c.models.Enum)15 Source (com.spectralogic.ds3autogen.c.models.Source)9 CodeGenerator (com.spectralogic.ds3autogen.api.CodeGenerator)5 Ds3DocSpec (com.spectralogic.ds3autogen.api.models.docspec.Ds3DocSpec)5 NameMapper (com.spectralogic.ds3autogen.NameMapper)4 Ds3DocSpecParser (com.spectralogic.ds3autogen.api.Ds3DocSpecParser)4 Ds3DocSpecParserImpl (com.spectralogic.ds3autogen.docspec.Ds3DocSpecParserImpl)4 JavaCodeGenerator (com.spectralogic.ds3autogen.java.JavaCodeGenerator)4 ImmutableMap (com.google.common.collect.ImmutableMap)2 FileUtils (com.spectralogic.ds3autogen.api.FileUtils)2 Request (com.spectralogic.ds3autogen.c.models.Request)2 GoCodeGenerator (com.spectralogic.ds3autogen.go.GoCodeGenerator)2 NetCodeGenerator (com.spectralogic.ds3autogen.net.NetCodeGenerator)2