| java.lang.Object org.restlet.Uniform org.restlet.Restlet org.restlet.Finder
All known Subclasses: org.restlet.ext.spring.SpringFinder, org.restlet.Directory,
Finder | public class Finder extends Restlet (Code) | | Restlet that can find the target resource that will concretely handle a call.
Based on a given resource class, it is also capable of instantiating the
resource with the call's context, request and response without requiring the
usage of a subclass. It will use either the constructor with three arguments:
context, request, response; or it will invoke the default constructor then
invoke the init() method with the same arguments.
Once the target resource has been found, the call is automatically dispatched
to the appropriate handle*() method (where the '*' character corresponds to
the method name) if the corresponding allow*() method returns true.
For example, if you want to support a MOVE method for a WebDAV server, you
just have to add a handleMove() method in your subclass of Resource and it
will be automatically be used by the Finder instance at runtime.
If no matching handle*() method is found, then a
Status.CLIENT_ERROR_METHOD_NOT_ALLOWED is returned.
See Also: Tutorial: Reaching
* target Resources author: Jerome Louvel (contact@noelios.com) |
Finder | public Finder()(Code) | | Constructor.
|
Finder | public Finder(Context context)(Code) | | Constructor.
Parameters: context - The context. |
Finder | public Finder(Context context, Class<? extends Resource> targetClass)(Code) | | Constructor.
Parameters: context - The context. Parameters: targetClass - The target resource class. |
createResource | public Resource createResource(Request request, Response response)(Code) | | Creates a new instance of the resource class designated by the
"targetClass" property.
Parameters: request - The request to handle. Parameters: response - The response to update. The created resource or null. |
getTargetClass | public Class<? extends Resource> getTargetClass()(Code) | | Returns the target Resource class.
the target Resource class. |
handle | public void handle(Request request, Response response)(Code) | | Handles a call.
Parameters: request - The request to handle. Parameters: response - The response to update. |
|
|