Package org.opensaml.messaging.encoder.servlet

# Class AbstractHttpServletResponseMessageEncoder

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.messaging.encoder.AbstractMessageEncoder
org.opensaml.messaging.encoder.servlet.AbstractHttpServletResponseMessageEncoder

All Implemented Interfaces:
  `Component`, `DestructableComponent`, `InitializableComponent`, `UnmodifiableComponent`, `MessageEncoder`, `HttpServletResponseMessageEncoder`

Direct Known Subclasses:
  `BaseHttpServletResponseXMLMessageEncoder`

public abstract class AbstractHttpServletResponseMessageEncoder extends AbstractMessageEncoder implements HttpServletResponseMessageEncoder
Abstract implementation of `HttpServletResponseMessageEncoder`.

## Field Summary

Fields
Modifier and Type
Field
Description
`private NonnullSupplier<HttpServletResponse>`
`httpServletResponseSupplier`
Supplier for the Current HTTP servlet response, if available.

### Fields inherited from class org.opensaml.messaging.encoder.AbstractMessageEncoder

`BASE_PROTOCOL_MESSAGE_LOGGER_CATEGORY`

## Constructor Summary

Constructors
Constructor
Description
`AbstractHttpServletResponseMessageEncoder()`

## Method Summary

Modifier and Type
Method
Description
`protected void`
`doInitialize()`
`HttpServletResponse`
`getHttpServletResponse()`
Get the current Http Servlet response if available.
`NonnullSupplier<HttpServletResponse>`
`getHttpServletResponseSupplier()`
Get the supplier for the current HTTP response if available.
`void`
`setHttpServletResponseSupplier(NonnullSupplier<HttpServletResponse> supplier)`
Set the supplier for the HTTP servlet response on which to operate.

### Methods inherited from class org.opensaml.messaging.encoder.AbstractMessageEncoder

`doEncode, encode, getMessageContext, getMessageToLog, getProtocolMessageLogger, getProtocolMessageLoggerSubCategory, logEncodedMessage, prepareContext, serializeMessageForLogging, setMessageContext, setProtocolMessageLoggerSubCategory`

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized`

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

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

### Methods inherited from interface net.shibboleth.shared.component.DestructableComponent

`destroy, isDestroyed`

### Methods inherited from interface net.shibboleth.shared.component.InitializableComponent

`initialize, isInitialized`

### Methods inherited from interface org.opensaml.messaging.encoder.MessageEncoder

`encode, prepareContext, setMessageContext`

## Field Details

### httpServletResponseSupplier

@Nullable private NonnullSupplier<HttpServletResponse> httpServletResponseSupplier
Supplier for the Current HTTP servlet response, if available.

## Constructor Details

### AbstractHttpServletResponseMessageEncoder

public AbstractHttpServletResponseMessageEncoder()

## Method Details

### getHttpServletResponse

@NonnullAfterInit public HttpServletResponse getHttpServletResponse()
Get the current Http Servlet response if available.

Specified by:
  `getHttpServletResponse` in interface `HttpServletResponseMessageEncoder`
Returns:
  current Http Servlet response or null

### setHttpServletResponseSupplier

public void setHttpServletResponseSupplier(@Nullable NonnullSupplier<HttpServletResponse> supplier)
Set the supplier for the HTTP servlet response on which to operate.

Specified by:
  `setHttpServletResponseSupplier` in interface `HttpServletResponseMessageEncoder`
Parameters:
  `supplier` - the supplier for the HTTP servlet response

### getHttpServletResponseSupplier

@NonnullAfterInit public NonnullSupplier<HttpServletResponse> getHttpServletResponseSupplier()
Get the supplier for the current HTTP response if available.

Returns:
  the supplier for the current HTTP response or null

### doInitialize

protected void doInitialize() throws ComponentInitializationException

Overrides:
  `doInitialize` in class `AbstractMessageEncoder`
Throws:
  `ComponentInitializationException`