org.restlet.engine

## Class ChainHelper<T extends Restlet>

- java.lang.Object
- - org.restlet.engine.Helper
  - - org.restlet.engine.RestletHelper<T>
    - - org.restlet.engine.ChainHelper<T>

Direct Known Subclasses:
  ApplicationHelper, ComponentHelper

    public abstract class ChainHelper<T extends Restlet>
    extends RestletHelper<T>

Chain helper serving as base class for Application and Component helpers.

Author:
  Jerome Louvel

### Constructor Summary

Constructors
Constructor and Description
`ChainHelper(T helped)` Constructor.

### Method Summary

Methods
`protected void` `addFilter(Filter filter)` Adds a new filter to the chain.
`void` `clear()` Clears the chain.
`protected Restlet` `getFirst()` Returns the first Restlet.
`protected Filter` `getLast()` Returns the last Filter.
`void` `handle(Request request, Response response)` Handles a call.
`protected void` `setFirst(Restlet first)` Sets the first Restlet.
`protected void` `setLast(Filter last)` Sets the last Filter.
`protected void` `setNext(Restlet next)` Sets the next Restlet after the chain.

### Methods inherited from class org.restlet.engine.RestletHelper

`getAttributes, getContext, getHelped, getHelpedParameters, getLogger, getMetadataService, setHelped, start, stop, update`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ChainHelper

    public ChainHelper(T helped)

Constructor.

Parameters:
  `helped` - The helped Restlet.

### Method Detail

#### addFilter

    protected void addFilter(Filter filter)

Adds a new filter to the chain.

Parameters:
  `filter` - The filter to add.

#### clear

    public void clear()

Clears the chain. Sets the first and last filters to null.

#### getFirst

    protected Restlet getFirst()

Returns the first Restlet.

Returns:
  the first Restlet.

#### getLast

    protected Filter getLast()

Returns the last Filter.

Returns:
  the last Filter.

#### handle

    public void handle(Request request,
              Response response)

Description copied from class: `RestletHelper`
Handles a call.

Overrides:
  `handle` in class `RestletHelper<T extends Restlet>`
Parameters:
  `request` - The request to handle.
  `response` - The response to update.

#### setFirst

    protected void setFirst(Restlet first)

Sets the first Restlet.

Parameters:
  `first` - The first Restlet.

#### setLast

    protected void setLast(Filter last)

Sets the last Filter.

Parameters:
  `last` - The last Filter.

#### setNext

    protected void setNext(Restlet next)

Sets the next Restlet after the chain.

Parameters:
  `next` - The Restlet to process after the chain.