Package com.atlassian.json.schema

Examples of com.atlassian.json.schema.JsonSchemaGeneratorProvider


        try
        {
            Gson gson = new GsonBuilder().setFieldNamingStrategy(new SchemaFieldNamingStrategy()).create();
            Gson prettyGson = new GsonBuilder().setPrettyPrinting().setFieldNamingStrategy(new SchemaFieldNamingStrategy()).create();
           
            JsonSchemaGeneratorProvider provider = getProvider();
            JsonSchemaDocs schemaDocs = new JsonSchemaDocs();
            InterfaceList interfaceList = new InterfaceList();
           
            File docsFile = new File(getDefaultDocsFile());
            File interfacesFile = new File(getDefaultInterfacesFile());

            if (docsFile.exists() && docsFile.canRead())
            {
                String docsJson = Files.toString(docsFile, Charsets.UTF_8);
                schemaDocs = gson.fromJson(docsJson,JsonSchemaDocs.class);
            }

            if (interfacesFile.exists() && interfacesFile.canRead())
            {
                String ifaceJson = Files.toString(interfacesFile, Charsets.UTF_8);
                interfaceList = gson.fromJson(ifaceJson,InterfaceList.class);
            }

            JsonSchemaGenerator generator = provider.provide(getEnumCase(enumCase),interfaceList,schemaDocs,ignoreFilter);
            JsonSchema schema = generator.generateSchema(getRootClass());
           
            File rawFile = new File(rawOutput);
            File prettyFile = new File(prettyOutput);
           
View Full Code Here

TOP

Related Classes of com.atlassian.json.schema.JsonSchemaGeneratorProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.