public class Injector extends Filter
Filter
that adds values to the request attributes before moving to
the next restlet. It allows for a straightforward implementation of IoC
(Inversion of Control).
If values are of class Template
, then they will be cast using the
request and response before added.
Constructor and Description |
---|
Injector()
Constructor.
|
Injector(Context context)
Constructor.
|
Injector(Context context,
Restlet next)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected int |
beforeHandle(Request request,
Response response) |
ConcurrentMap<String,Object> |
getValues()
The values to be added to the request attributes.
|
String |
toString() |
afterHandle, doHandle, getNext, handle, hasNext, setNext, setNext, start, stop
createFinder, finalize, getApplication, getAuthor, getContext, getDescription, getFinderClass, getLogger, getName, getOwner, handle, handle, handle, isStarted, isStopped, setAuthor, setContext, setDescription, setFinderClass, setName, setOwner
public Injector()
public Injector(Context context)
context
- The contextpublic ConcurrentMap<String,Object> getValues()
protected int beforeHandle(Request request, Response response)
beforeHandle
in class Filter
Copyright © 2009-2016 Three Crickets LLC.