org.xins.common.spec
Class APISpec

java.lang.Object
  extended byorg.xins.common.spec.APISpec

public final class APISpec
extends Object

Specification of an API. This class gets the specification of the API as defined in the api.xml file.

Since:
XINS 1.3.0
Version:
$Revision: 1.12 $ $Date: 2006/08/28 09:12:34 $
Author:
Anthony Goubard

Constructor Summary
APISpec(Class reference, String baseURL)
          Creates a new instance of APISpec.
 
Method Summary
 String getDescription()
          Gets the description of the API.
 FunctionSpec getFunction(String functionName)
          Gets the specification of the given function.
 Map 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

APISpec

public APISpec(Class reference,
               String baseURL)
        throws IllegalArgumentException,
               InvalidSpecificationException
Creates a new instance of APISpec.

Parameters:
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.
Throws:
IllegalArgumentException - if reference == null || baseURL == null.
InvalidSpecificationException - if the result code file cannot be found or is incorrect.
Method Detail

getName

public String getName()
Gets the name of the API.

Returns:
the name of the API, never null.

getOwner

public String getOwner()
Gets the owner of the API.

Returns:
the owner of the API or null if no owner is defined.

getDescription

public String getDescription()
Gets the description of the API. The description will be the text specified in the description element of the API specification file.

Returns:
the description of the API, never null.

getFunctions

public Map getFunctions()
Gets the function specifications defined in the API. The key of the returned Map is the name of the function and the value is the FunctionSpec object. The values in the Map are never null.

Returns:
the function specifications, never null.

getFunction

public FunctionSpec getFunction(String functionName)
                         throws IllegalArgumentException,
                                EntityNotFoundException
Gets the specification of the given function.

Parameters:
functionName - The name of the function, can not be null
Returns:
The function specification, never null.
Throws:
IllegalArgumentException - if functionName == null.
EntityNotFoundException - If the API does not define any function for the given name.


See http://www.xins.org/.