Interface ContentPreviewerFactory
public interface ContentPreviewerFactory
A factory creating a
ContentPreviewer
.-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Returns a newly createdContentPreviewerFactoryBuilder
.requestContentPreviewer
(RequestContext ctx, RequestHeaders headers) responseContentPreviewer
(RequestContext ctx, ResponseHeaders resHeaders) Returns a newly-created responseContentPreviewer
with the givenRequestContext
andResponseHeaders
.static ContentPreviewerFactory
text
(int maxLength) Returns a newContentPreviewerFactory
which creates aContentPreviewer
.static ContentPreviewerFactory
Returns a newContentPreviewerFactory
which creates aContentPreviewer
.
-
Method Details
-
builder
Returns a newly createdContentPreviewerFactoryBuilder
. -
text
Returns a newContentPreviewerFactory
which creates aContentPreviewer
. TheContentPreviewer
produces the text with themaxLength
limit if the content type of theRequestHeaders
orResponseHeaders
meets any of the following conditions:- when it matches
text/*
orapplication/x-www-form-urlencoded
- when its charset has been specified
- when its subtype is
"xml"
or"json"
- when its subtype ends with
"+xml"
or"+json"
- Parameters:
maxLength
- the maximum length of the preview
- when it matches
-
text
Returns a newContentPreviewerFactory
which creates aContentPreviewer
. TheContentPreviewer
produces the text with themaxLength
limit if the content type of theRequestHeaders
orResponseHeaders
meets any of the following conditions:- when it matches
text/*
orapplication/x-www-form-urlencoded
- when its charset has been specified
- when its subtype is
"xml"
or"json"
- when its subtype ends with
"+xml"
or"+json"
- Parameters:
maxLength
- the maximum length of the previewdefaultCharset
- the default charset used when a charset is not specified in the"content-type"
header
- when it matches
-
requestContentPreviewer
Returns a newly-created requestContentPreviewer
with the givenRequestContext
andRequestHeaders
. Note that the returnedContentPreviewer
can beContentPreviewer.disabled()
. -
responseContentPreviewer
Returns a newly-created responseContentPreviewer
with the givenRequestContext
andResponseHeaders
. Note that the returnedContentPreviewer
can beContentPreviewer.disabled()
.
-