Package net.officefloor.web.accept
Class AcceptNegotiatorImpl<H>
- java.lang.Object
-
- net.officefloor.web.accept.AcceptNegotiatorImpl<H>
-
- All Implemented Interfaces:
AcceptNegotiator<H>
public class AcceptNegotiatorImpl<H> extends java.lang.Object implements AcceptNegotiator<H>
AcceptNegotiator
implementation.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AcceptNegotiatorImpl.AcceptHandler<H>
Accept handler.
-
Constructor Summary
Constructors Constructor Description AcceptNegotiatorImpl(AcceptNegotiatorImpl.AcceptHandler<H>[] acceptHandlers)
Instantiate.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <H> AcceptNegotiatorImpl.AcceptHandler<H>
createAcceptHandler(java.lang.String contentType, H handler)
Creates theAcceptNegotiatorImpl.AcceptHandler
.H
getHandler(HttpRequest request)
Obtains the acceptable handler for theHttpRequest
.
-
-
-
Constructor Detail
-
AcceptNegotiatorImpl
public AcceptNegotiatorImpl(AcceptNegotiatorImpl.AcceptHandler<H>[] acceptHandlers)
Instantiate.- Parameters:
acceptHandlers
-AcceptNegotiatorImpl.AcceptHandler
instances.
-
-
Method Detail
-
createAcceptHandler
public static <H> AcceptNegotiatorImpl.AcceptHandler<H> createAcceptHandler(java.lang.String contentType, H handler)
Creates theAcceptNegotiatorImpl.AcceptHandler
.- Type Parameters:
H
- Handle type.- Parameters:
contentType
-Content-Type
handler
- Handler.- Returns:
AcceptNegotiatorImpl.AcceptHandler
.
-
getHandler
public H getHandler(HttpRequest request)
Description copied from interface:AcceptNegotiator
Obtains the acceptable handler for theHttpRequest
.- Specified by:
getHandler
in interfaceAcceptNegotiator<H>
- Parameters:
request
-HttpRequest
.- Returns:
- Acceptable handler, or
null
if no acceptable handler.
-
-