@FunctionalInterface public interface ContentPreviewerFactory
ContentPreviewer.| Modifier and Type | Method and Description |
|---|---|
static ContentPreviewerFactory |
disabled()
A dummy
ContentPreviewerFactory which returns ContentPreviewer.disabled(). |
ContentPreviewer |
get(RequestContext ctx,
HttpHeaders headers)
|
static ContentPreviewerFactory |
of(ContentPreviewerFactory... factories)
Creates a new instance of
ContentPreviewerFactory
which wraps a list of ContentPreviewerFactorys. |
static ContentPreviewerFactory |
of(Iterable<? extends ContentPreviewerFactory> factories)
Creates a new instance of
ContentPreviewerFactory
which wraps a list of ContentPreviewerFactorys. |
static ContentPreviewerFactory |
of(Map<MediaType,? extends Supplier<? extends ContentPreviewer>> map)
Creates a new instance of
ContentPreviewerFactory which creates a ContentPreviewer
through the supplier that matches with "content-type" header. |
static ContentPreviewerFactory |
of(MediaType contentType,
Supplier<? extends ContentPreviewer> supplier)
Creates a new instance of
ContentPreviewerFactory which creates a ContentPreviewer
through supplier for the request/response with the contentType. |
static ContentPreviewerFactory |
of(String contentType,
Supplier<? extends ContentPreviewer> supplier)
Creates a new instance of
ContentPreviewerFactory which creates a ContentPreviewer
through supplier for the request/response with the contentType. |
static ContentPreviewerFactory |
of(Supplier<? extends ContentPreviewer> supplier,
Iterable<MediaType> contentTypes)
Creates a new instance of
ContentPreviewerFactory which creates a ContentPreviewer
through supplier if a request/response matches any of contentTypes. |
static ContentPreviewerFactory |
of(Supplier<? extends ContentPreviewer> supplier,
MediaType... contentTypes)
Creates a new instance of
ContentPreviewerFactory which creates a ContentPreviewer
through supplier if a request/response matches any of contentTypes. |
static ContentPreviewerFactory |
of(Supplier<? extends ContentPreviewer> supplier,
String... contentTypes)
Creates a new instance of
ContentPreviewerFactory which creates a ContentPreviewer
through supplier if the content type of a request/response matches any of contentTypes. |
static ContentPreviewerFactory |
ofText(int length)
Creates a new instance of
ContentPreviewerFactory for creating a ContentPreviewer. |
static ContentPreviewerFactory |
ofText(int length,
Charset defaultCharset)
Creates a new instance of
ContentPreviewerFactory for creating a ContentPreviewer. |
static ContentPreviewerFactory |
ofText(int length,
Charset defaultCharset,
Iterable<MediaType> contentTypes)
Creates a new instance of
ContentPreviewerFactory for creating a ContentPreviewer
which produces the text with the maximum length
if the content type of a request/response matches any of contentTypes. |
static ContentPreviewerFactory |
ofText(int length,
Charset defaultCharset,
MediaType... contentTypes)
Creates a new instance of
ContentPreviewerFactory for creating a ContentPreviewer
which produces the text with the maximum length
if the content type of a request/response matches any of contentTypes. |
static ContentPreviewerFactory |
ofText(int length,
Charset defaultCharset,
String... contentTypes)
Creates a new instance of
ContentPreviewerFactory for creating a ContentPreviewer
which produces the text with the maximum length limit
if the content type of a request/response matches any of contentTypes. |
static ContentPreviewerFactory of(MediaType contentType, Supplier<? extends ContentPreviewer> supplier)
ContentPreviewerFactory which creates a ContentPreviewer
through supplier for the request/response with the contentType.static ContentPreviewerFactory of(String contentType, Supplier<? extends ContentPreviewer> supplier)
ContentPreviewerFactory which creates a ContentPreviewer
through supplier for the request/response with the contentType.static ContentPreviewerFactory of(ContentPreviewerFactory... factories)
ContentPreviewerFactory
which wraps a list of ContentPreviewerFactorys.static ContentPreviewerFactory of(Iterable<? extends ContentPreviewerFactory> factories)
ContentPreviewerFactory
which wraps a list of ContentPreviewerFactorys.static ContentPreviewerFactory of(Map<MediaType,? extends Supplier<? extends ContentPreviewer>> map)
ContentPreviewerFactory which creates a ContentPreviewer
through the supplier that matches with "content-type" header.static ContentPreviewerFactory of(Supplier<? extends ContentPreviewer> supplier, Iterable<MediaType> contentTypes)
ContentPreviewerFactory which creates a ContentPreviewer
through supplier if a request/response matches any of contentTypes.static ContentPreviewerFactory of(Supplier<? extends ContentPreviewer> supplier, MediaType... contentTypes)
ContentPreviewerFactory which creates a ContentPreviewer
through supplier if a request/response matches any of contentTypes.static ContentPreviewerFactory of(Supplier<? extends ContentPreviewer> supplier, String... contentTypes)
ContentPreviewerFactory which creates a ContentPreviewer
through supplier if the content type of a request/response matches any of contentTypes.static ContentPreviewerFactory ofText(int length, Charset defaultCharset, Iterable<MediaType> contentTypes)
ContentPreviewerFactory for creating a ContentPreviewer
which produces the text with the maximum length
if the content type of a request/response matches any of contentTypes.static ContentPreviewerFactory ofText(int length, Charset defaultCharset, MediaType... contentTypes)
ContentPreviewerFactory for creating a ContentPreviewer
which produces the text with the maximum length
if the content type of a request/response matches any of contentTypes.static ContentPreviewerFactory ofText(int length, Charset defaultCharset, String... contentTypes)
ContentPreviewerFactory for creating a ContentPreviewer
which produces the text with the maximum length limit
if the content type of a request/response matches any of contentTypes.static ContentPreviewerFactory ofText(int length, Charset defaultCharset)
ContentPreviewerFactory for creating a ContentPreviewer.
The previewer produces the text with the maximum length limit
if the content type of a request/response meets
any of the following conditions:
text/* or application/x-www-form-urlencoded"xml" or "json""+xml" or "+json"length - the maximum length of the previewdefaultCharset - the default charset used when a charset is not specified in the
"content-type" headerstatic ContentPreviewerFactory ofText(int length)
ContentPreviewerFactory for creating a ContentPreviewer.
The previewer produces the text with the maximum length limit
if the content type of a request/response meets
any of the following conditions:
text/* or application/x-www-form-urlencoded"xml" or "json""+xml" or "+json"length - the maximum length of the preview.static ContentPreviewerFactory disabled()
ContentPreviewerFactory which returns ContentPreviewer.disabled().ContentPreviewer get(RequestContext ctx, HttpHeaders headers)
Copyright © 2020 LeanCloud. All rights reserved.