io.undertow.server.handlers

## Class SetAttributeHandler

- java.lang.Object
- - io.undertow.server.handlers.SetAttributeHandler

All Implemented Interfaces:
  HttpHandler

    public class SetAttributeHandler
    extends Object
    implements HttpHandler

Handler that can set an arbitrary attribute on the exchange. Both the attribute and the value to set are expressed as exchange attributes.

Author:
  Stuart Douglas

### Nested Class Summary

Nested Classes
`static class` `SetAttributeHandler.Builder`
`static class` `SetAttributeHandler.ClearBuilder`

### Constructor Summary

Constructors
Constructor and Description
`SetAttributeHandler(HttpHandler next, ExchangeAttribute attribute, ExchangeAttribute value)`
`SetAttributeHandler(HttpHandler next, ExchangeAttribute attribute, ExchangeAttribute value, boolean preCommit)`
`SetAttributeHandler(HttpHandler next, String attribute, String value)`
`SetAttributeHandler(HttpHandler next, String attribute, String value, boolean preCommit)`
`SetAttributeHandler(HttpHandler next, String attribute, String value, ClassLoader classLoader)`
`SetAttributeHandler(HttpHandler next, String attribute, String value, ClassLoader classLoader, boolean preCommit)`

### Method Summary

All Methods Instance Methods Concrete Methods
`ExchangeAttribute` `getValue()`
`void` `handleRequest(HttpServerExchange exchange)` Handle the request.
`String` `toString()`

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

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

### Constructor Detail

#### SetAttributeHandler

    public SetAttributeHandler(HttpHandler next,
                               ExchangeAttribute attribute,
                               ExchangeAttribute value)

#### SetAttributeHandler

    public SetAttributeHandler(HttpHandler next,
                               String attribute,
                               String value)

#### SetAttributeHandler

    public SetAttributeHandler(HttpHandler next,
                               String attribute,
                               String value,
                               ClassLoader classLoader)

#### SetAttributeHandler

    public SetAttributeHandler(HttpHandler next,
                               ExchangeAttribute attribute,
                               ExchangeAttribute value,
                               boolean preCommit)

#### SetAttributeHandler

    public SetAttributeHandler(HttpHandler next,
                               String attribute,
                               String value,
                               boolean preCommit)

#### SetAttributeHandler

    public SetAttributeHandler(HttpHandler next,
                               String attribute,
                               String value,
                               ClassLoader classLoader,
                               boolean preCommit)

### Method Detail

#### getValue

    public ExchangeAttribute getValue()

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

#### handleRequest

    public void handleRequest(HttpServerExchange exchange)
                       throws Exception

Description copied from interface: `HttpHandler`
Handle the request.

Specified by:
  `handleRequest` in interface `HttpHandler`
Parameters:
  `exchange` - the HTTP request/response exchange
Throws:
  `Exception`