/**
* httl.properties: interceptors=httl.spi.interceptors.ExtendsInterceptor
*/
@Reqiured
public void setInterceptors(Interceptor[] interceptors) {
Listener last = null;
for (int i = interceptors.length - 1; i >= 0; i--) {
final Interceptor current = interceptors[i];
final Listener next = last;
last = new Listener() {
public void render(Context context) throws IOException, ParseException {
if (next == null) {
Listener listener = (Listener) context.get(LISTENER_KEY);
if (listener != null) {
current.render(context, listener);
}
} else {
current.render(context, next);