com.smartbear.swagger4j
Class URISwaggerSource

java.lang.Object
  extended by com.smartbear.swagger4j.URISwaggerSource
All Implemented Interfaces:
SwaggerSource

public class URISwaggerSource
extends Object
implements SwaggerSource

SwaggerSource for reading Swagger definitions from a base URI. The extension of the URI will be used to decide on the format (.json / .xml)


Constructor Summary
URISwaggerSource(URI uri)
           
 
Method Summary
static URI buildUri(URI uri, String path, Constants.Format format)
           
static Constants.Format extractFormat(URI uri)
           
 Constants.Format getFormat()
          Gets the format of the Swagger objects returned by this Source
 Reader readApiDeclaration(String basePath, String path)
          Gets a Reader for an API Declaration with the specified path.
 Reader readResourceListing()
          Gets a Reader for the ResourceListing of this SwaggerSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URISwaggerSource

public URISwaggerSource(URI uri)
Method Detail

buildUri

public static URI buildUri(URI uri,
                           String path,
                           Constants.Format format)

extractFormat

public static Constants.Format extractFormat(URI uri)

readResourceListing

public Reader readResourceListing()
                           throws IOException
Description copied from interface: SwaggerSource
Gets a Reader for the ResourceListing of this SwaggerSource

Specified by:
readResourceListing in interface SwaggerSource
Returns:
a Reader for the Swagger Resource Listing
Throws:
IOException

readApiDeclaration

public Reader readApiDeclaration(String basePath,
                                 String path)
                          throws IOException
Description copied from interface: SwaggerSource
Gets a Reader for an API Declaration with the specified path. Generally this path will be taken from the path of containing Resource Listings API

Specified by:
readApiDeclaration in interface SwaggerSource
path - the path of the API Declaration
Returns:
a Reader for the API Declaration
Throws:
IOException

getFormat

public Constants.Format getFormat()
Description copied from interface: SwaggerSource
Gets the format of the Swagger objects returned by this Source

Specified by:
getFormat in interface SwaggerSource
Returns:
the format of the Swagger objects returned by this Source


Copyright © 2013. All Rights Reserved.