com.smartbear.swagger4j
Interface SwaggerFactory

All Known Implementing Classes:
SwaggerFactoryImpl

public interface SwaggerFactory

Factory class for creating Swagger objects and related readers/writers


Method Summary
 ApiDeclaration createApiDeclaration(String basePath, String resourcePath)
          Creates an empty ApiDeclaration with the specified basePath and resourcePath
 ResourceListing createResourceListing(String basePath)
          Creates an empty ResourceListing with the specified basePath to use for resolving contained API declaration references
 SwaggerReader createSwaggerReader()
          Creates a SwaggerReader that can read Swagger objects
 SwaggerWriter createSwaggerWriter(Constants.Format format)
          Creates a SwaggerWriter for the specified format
 

Method Detail

createResourceListing

ResourceListing createResourceListing(String basePath)
Creates an empty ResourceListing with the specified basePath to use for resolving contained API declaration references

Parameters:
basePath - the basePath of the ResourceListing
Returns:
an empty ResourceListing object

createApiDeclaration

ApiDeclaration createApiDeclaration(String basePath,
                                    String resourcePath)
Creates an empty ApiDeclaration with the specified basePath and resourcePath

Parameters:
basePath - used to resolve API paths defined in this declaration
resourcePath - path to the actual resource described in the declaration
Returns:
an empty ApiDeclaration

createSwaggerReader

SwaggerReader createSwaggerReader()
Creates a SwaggerReader that can read Swagger objects

Returns:
a SwaggerReader

createSwaggerWriter

SwaggerWriter createSwaggerWriter(Constants.Format format)
Creates a SwaggerWriter for the specified format

Parameters:
format - the format to use when writing, either json or xml
Returns:
a SwaggerWriter


Copyright © 2013. All Rights Reserved.