com.ramblingwood.minecraft.jsonapi.api
Interface JSONAPICallHandler


public interface JSONAPICallHandler

A simple way to add/overload JSONAPI method calls. Just make sure you register the class that implements this interface with JSONAPI" https://github.com/alecgorge/jsonapi/wiki/Integration-guide-for-normal-api-methods

Author:
alecgorge

Method Summary
 java.lang.Object handle(APIMethodName methodName, java.lang.Object[] args)
          The result of this method will be treated as the response to the API request, even if null is returned (some methods do return null).
 boolean willHandle(APIMethodName methodName)
          If you return true here, you WILL handle the API call in the handle method.
 

Method Detail

willHandle

boolean willHandle(APIMethodName methodName)
If you return true here, you WILL handle the API call in the handle method. This method will be called twice for every API call, once to test if the method exists and once on the actual call.


handle

java.lang.Object handle(APIMethodName methodName,
                        java.lang.Object[] args)
The result of this method will be treated as the response to the API request, even if null is returned (some methods do return null).

Parameters:
methodName - The name of the method (such as "remotetoolkit.startServer" or "getServer").
args - The arguments passed to the method. The arguments are not validated or necessarily the right length.
Returns:
Whatever you want the response to the API method to be.