public final class APISpec extends Object
Constructor and Description |
---|
APISpec(Class reference,
String baseURL)
Creates a new instance of
APISpec . |
Modifier and Type | Method and Description |
---|---|
String |
getDescription()
Gets the description of the API.
|
FunctionSpec |
getFunction(String functionName)
Gets the specification of the given function.
|
Map<String,FunctionSpec> |
getFunctions()
Gets the function specifications defined in the API.
|
String |
getName()
Gets the name of the API.
|
String |
getOwner()
Gets the owner of the API.
|
public APISpec(Class reference, String baseURL) throws IllegalArgumentException, InvalidSpecificationException
APISpec
.reference
- the reference class used to get the type of the parameters, cannot be null
.baseURL
- the base URL path where are located the specifications, cannot be null
.IllegalArgumentException
- if reference == null || baseURL == null
.InvalidSpecificationException
- if the result code file cannot be found or is incorrect.public String getName()
null
.public String getOwner()
null
if no owner is defined.public String getDescription()
null
.public Map<String,FunctionSpec> getFunctions()
Map
is the name of the function and the
value is the FunctionSpec
object. The values in the Map
are never null
.null
.public FunctionSpec getFunction(String functionName) throws IllegalArgumentException, EntityNotFoundException
functionName
- The name of the function, can not be null
null
.IllegalArgumentException
- if functionName == null
.EntityNotFoundException
- If the API does not define any function for the given name.See http://www.xins.org/.