Package | Description |
---|---|
org.jooby |
do more, more easily
|
Modifier and Type | Field and Description |
---|---|
static MediaType |
MediaType.all
Any media type.
|
static MediaType |
MediaType.css
Stylesheet media type.
|
static MediaType |
MediaType.form
Form url encoded.
|
static MediaType |
MediaType.html
HTML media type.
|
static MediaType |
MediaType.js
Javascript media types.
|
static MediaType |
MediaType.json
A JSON media type.
|
static MediaType |
MediaType.multipart
Form multipart-data media type.
|
static MediaType |
MediaType.octetstream
The default binary media type.
|
static MediaType |
MediaType.plain
Text plain media type.
|
static MediaType |
MediaType.sse
Server sent event type.
|
static MediaType |
MediaType.text
Any text media type.
|
static MediaType |
MediaType.xml
Xml media type.
|
Modifier and Type | Field and Description |
---|---|
static List<MediaType> |
MediaType.ALL
Any media type.
|
Modifier and Type | Method and Description |
---|---|
MediaType |
WebSocket.consumes() |
MediaType |
WebSocket.Definition.consumes() |
MediaType |
WebSocket.produces() |
MediaType |
WebSocket.Definition.produces() |
MediaType |
Request.type() |
MediaType |
Request.Forwarding.type() |
MediaType |
Upload.type() |
MediaType |
Parser.Context.type()
Content Type header, if current context was bind to a HTTP body via
Request.body() . |
MediaType |
Asset.type() |
MediaType |
Asset.Forwarding.type() |
static MediaType |
MediaType.valueOf(String type)
Convert a media type expressed as String into a
MediaType . |
Modifier and Type | Method and Description |
---|---|
List<MediaType> |
Request.accept() |
List<MediaType> |
Request.Forwarding.accept() |
Optional<MediaType> |
Request.accepts(List<MediaType> types)
Check if the given types are acceptable, returning the best match when true, or else
Optional.empty.
|
Optional<MediaType> |
Request.Forwarding.accepts(List<MediaType> types) |
default Optional<MediaType> |
Request.accepts(MediaType... types)
Check if the given types are acceptable, returning the best match when true, or else
Optional.empty.
|
Optional<MediaType> |
Request.Forwarding.accepts(MediaType... types) |
default Optional<MediaType> |
Request.accepts(String... types)
Check if the given types are acceptable, returning the best match when true, or else
Optional.empty.
|
Optional<MediaType> |
Request.Forwarding.accepts(String... types) |
static Optional<MediaType> |
MediaType.byExtension(String ext)
Get a
MediaType for a file extension. |
static Optional<MediaType> |
MediaType.byFile(File file)
Get a
MediaType for a file. |
static Optional<MediaType> |
MediaType.byPath(Path path)
Get a
MediaType for a file path. |
static Optional<MediaType> |
MediaType.byPath(String path)
Get a
MediaType for a file path. |
List<MediaType> |
Route.consumes() |
List<MediaType> |
Route.Definition.consumes() |
List<MediaType> |
Route.Forwarding.consumes() |
List<MediaType> |
MediaType.Matcher.filter(List<MediaType> types)
Filter the accepted types and keep the most specifics media types.
|
Optional<MediaType> |
MediaType.Matcher.first(List<MediaType> candidates)
Given:
|
Optional<MediaType> |
MediaType.Matcher.first(MediaType candidate)
Given:
|
static List<MediaType> |
MediaType.parse(String value)
Convert a string separated by comma into one or more
MediaType . |
List<MediaType> |
Route.produces() |
List<MediaType> |
Route.Definition.produces() |
List<MediaType> |
Route.Forwarding.produces() |
Optional<MediaType> |
Sse.Event.type()
Event media type helps to render or format event data.
|
Optional<MediaType> |
Result.type() |
Optional<MediaType> |
Response.type() |
Optional<MediaType> |
Response.Forwarding.type() |
static List<MediaType> |
MediaType.valueOf(String... types)
Convert one or more media types expressed as String into a
MediaType . |
Modifier and Type | Method and Description |
---|---|
default Optional<MediaType> |
Request.accepts(MediaType... types)
Check if the given types are acceptable, returning the best match when true, or else
Optional.empty.
|
Optional<MediaType> |
Request.Forwarding.accepts(MediaType... types) |
boolean |
Renderer.Context.accepts(MediaType type)
True if the given type matches the
Accept header. |
boolean |
Route.Definition.canConsume(MediaType type)
Test if the route definition can consume a media type.
|
boolean |
Route.Definition.canProduce(MediaType... types)
Test if the route definition can consume a media type.
|
int |
MediaType.compareTo(MediaType that) |
default T |
Route.Props.consumes(MediaType... consumes)
Set the media types the route can consume.
|
WebSocket.Definition |
WebSocket.Definition.consumes(MediaType type)
Set the media types the route can consume.
|
Optional<MediaType> |
MediaType.Matcher.first(MediaType candidate)
Given:
|
default boolean |
Request.is(MediaType... types)
True, if request accept any of the given types.
|
boolean |
Request.Forwarding.is(MediaType... types) |
static MediaType.Matcher |
MediaType.matcher(MediaType acceptable)
Produces a matcher for the given media type.
|
boolean |
MediaType.matches(MediaType that) |
boolean |
MediaType.Matcher.matches(MediaType candidate)
Given:
|
Optional<Route> |
Route.Definition.matches(String method,
String path,
MediaType contentType,
List<MediaType> accept)
Test if the route matches the given verb, path, content type and accept header.
|
default T |
Route.Props.produces(MediaType... produces)
Set the media types the route can produces.
|
WebSocket.Definition |
WebSocket.Definition.produces(MediaType type)
Set the media types the route can produces.
|
CompletableFuture<Optional<Object>> |
Sse.send(Object data,
MediaType type)
Send an event and set media type.
|
default <T> T |
Mutant.to(Class<T> type,
MediaType mtype)
Convert a raw value to the given type.
|
<T> T |
Mutant.to(com.google.inject.TypeLiteral<T> type,
MediaType mtype)
Convert a raw value to the given type.
|
Sse.Event |
Sse.Event.type(MediaType type)
Set event media type.
|
Result |
Result.type(MediaType type)
Set the content type of this content.
|
Renderer.Context |
Renderer.Context.type(MediaType type)
Set the
Content-Type header IF and ONLY IF, no Content-Type was set
yet. |
Response |
Response.type(MediaType type)
Set the response media type and set the
Content-Type header. |
Response |
Response.Forwarding.type(MediaType type) |
Result |
Result.when(MediaType type,
Supplier<Object> supplier)
Add a when clause for a custom result for the given media-type.
|
static Result |
Results.when(MediaType type,
Supplier<Object> supplier)
Performs content-negotiation on the Accept HTTP header on the request object.
|
Modifier and Type | Method and Description |
---|---|
Optional<MediaType> |
Request.accepts(List<MediaType> types)
Check if the given types are acceptable, returning the best match when true, or else
Optional.empty.
|
Optional<MediaType> |
Request.Forwarding.accepts(List<MediaType> types) |
boolean |
Route.Definition.canProduce(List<MediaType> types)
Test if the route definition can consume a media type.
|
T |
Route.Props.consumes(List<MediaType> consumes)
Set the media types the route can consume.
|
Route.Collection |
Route.Collection.consumes(List<MediaType> types) |
Route.Definition |
Route.Definition.consumes(List<MediaType> types) |
List<MediaType> |
MediaType.Matcher.filter(List<MediaType> types)
Filter the accepted types and keep the most specifics media types.
|
Optional<MediaType> |
MediaType.Matcher.first(List<MediaType> candidates)
Given:
|
<T> T |
Result.get(List<MediaType> types)
Get a result value for the given types (accept header).
|
Optional<Object> |
Result.ifGet(List<MediaType> types)
Get a result value for the given types (accept header).
|
default boolean |
Request.is(List<MediaType> types)
True, if request accept any of the given types.
|
boolean |
Request.Forwarding.is(List<MediaType> types) |
static MediaType.Matcher |
MediaType.matcher(List<MediaType> acceptable)
Produces a matcher for the given media types.
|
boolean |
MediaType.Matcher.matches(List<MediaType> candidates)
Given:
|
Optional<Route> |
Route.Definition.matches(String method,
String path,
MediaType contentType,
List<MediaType> accept)
Test if the route matches the given verb, path, content type and accept header.
|
T |
Route.Props.produces(List<MediaType> produces)
Set the media types the route can produces.
|
Route.Collection |
Route.Collection.produces(List<MediaType> types) |
Route.Definition |
Route.Definition.produces(List<MediaType> types) |
Copyright © 2020. All rights reserved.