Class AbstractRestResponse
java.lang.Object
com.aspectran.web.activity.response.AbstractRestResponse
- All Implemented Interfaces:
CustomTransformer
,RestResponse
- Direct Known Subclasses:
DefaultRestResponse
Abstract class shared by RestResponse.
Created: 2019-06-16
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractRestResponse
(Object data) AbstractRestResponse
(String name, Object data) -
Method Summary
Modifier and TypeMethodDescriptionaccepted()
Add the given single header value to the current list of values for the given header.conflict()
created()
defaultContentType
(MediaType defaultContentType) protected MediaType
determineContentType
(Activity activity) protected String
determineEncoding
(Activity activity) favorPathExtension
(boolean favorPathExtension) protected abstract MediaType
getContentTypeByPathExtension
(String extension) getData()
protected MultiValueMap<String,
String> getName()
int
ignoreAcceptHeader
(boolean ignoreAcceptHeader) ignoreUnknownPathExtensions
(boolean ignoreUnknownPathExtensions) boolean
boolean
boolean
boolean
notFound()
ok()
prettyPrint
(boolean prettyPrint) seeOther()
Specifies response data.Specifies response data with a name.void
setDefaultContentType
(MediaType defaultContentType) void
setDefaultContentType
(String defaultContentType) void
setFavorPathExtension
(boolean favorPathExtension) Set the given single header value under the given header name.void
setIgnoreAcceptHeader
(boolean ignoreAcceptHeader) void
setIgnoreUnknownPathExtensions
(boolean ignoreUnknownPathExtensions) void
setPrettyPrint
(boolean prettyPrint) Sets whether to apply indentations and line breaks when generating response data.setStatus
(int status) setStatus
(HttpStatus status) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.aspectran.core.activity.response.transform.CustomTransformer
transform
-
Constructor Details
-
AbstractRestResponse
public AbstractRestResponse() -
AbstractRestResponse
-
AbstractRestResponse
-
-
Method Details
-
getName
- Specified by:
getName
in interfaceRestResponse
-
getData
- Specified by:
getData
in interfaceRestResponse
-
setData
Description copied from interface:RestResponse
Specifies response data.- Specified by:
setData
in interfaceRestResponse
- Parameters:
data
- the response data
-
setData
Description copied from interface:RestResponse
Specifies response data with a name.- Specified by:
setData
in interfaceRestResponse
- Parameters:
name
- the name of the response datadata
- the response data
-
isPrettyPrint
public boolean isPrettyPrint()- Specified by:
isPrettyPrint
in interfaceRestResponse
-
setPrettyPrint
public void setPrettyPrint(boolean prettyPrint) Description copied from interface:RestResponse
Sets whether to apply indentations and line breaks when generating response data.- Specified by:
setPrettyPrint
in interfaceRestResponse
- Parameters:
prettyPrint
- true if responding with indentations and line breaks; otherwise false
-
prettyPrint
- Specified by:
prettyPrint
in interfaceRestResponse
-
isFavorPathExtension
public boolean isFavorPathExtension()- Specified by:
isFavorPathExtension
in interfaceRestResponse
-
setFavorPathExtension
public void setFavorPathExtension(boolean favorPathExtension) - Specified by:
setFavorPathExtension
in interfaceRestResponse
-
favorPathExtension
- Specified by:
favorPathExtension
in interfaceRestResponse
-
isIgnoreUnknownPathExtensions
public boolean isIgnoreUnknownPathExtensions()- Specified by:
isIgnoreUnknownPathExtensions
in interfaceRestResponse
-
setIgnoreUnknownPathExtensions
public void setIgnoreUnknownPathExtensions(boolean ignoreUnknownPathExtensions) - Specified by:
setIgnoreUnknownPathExtensions
in interfaceRestResponse
-
ignoreUnknownPathExtensions
- Specified by:
ignoreUnknownPathExtensions
in interfaceRestResponse
-
isIgnoreAcceptHeader
public boolean isIgnoreAcceptHeader()- Specified by:
isIgnoreAcceptHeader
in interfaceRestResponse
-
setIgnoreAcceptHeader
public void setIgnoreAcceptHeader(boolean ignoreAcceptHeader) - Specified by:
setIgnoreAcceptHeader
in interfaceRestResponse
-
ignoreAcceptHeader
- Specified by:
ignoreAcceptHeader
in interfaceRestResponse
-
getDefaultContentType
- Specified by:
getDefaultContentType
in interfaceRestResponse
-
setDefaultContentType
- Specified by:
setDefaultContentType
in interfaceRestResponse
-
setDefaultContentType
- Specified by:
setDefaultContentType
in interfaceRestResponse
-
defaultContentType
- Specified by:
defaultContentType
in interfaceRestResponse
-
ok
- Specified by:
ok
in interfaceRestResponse
-
created
- Specified by:
created
in interfaceRestResponse
-
created
- Specified by:
created
in interfaceRestResponse
-
accepted
- Specified by:
accepted
in interfaceRestResponse
-
noContent
- Specified by:
noContent
in interfaceRestResponse
-
movedPermanently
- Specified by:
movedPermanently
in interfaceRestResponse
-
seeOther
- Specified by:
seeOther
in interfaceRestResponse
-
notModified
- Specified by:
notModified
in interfaceRestResponse
-
temporaryRedirect
- Specified by:
temporaryRedirect
in interfaceRestResponse
-
badRequest
- Specified by:
badRequest
in interfaceRestResponse
-
unauthorized
- Specified by:
unauthorized
in interfaceRestResponse
-
forbidden
- Specified by:
forbidden
in interfaceRestResponse
-
notFound
- Specified by:
notFound
in interfaceRestResponse
-
methodNotAllowed
- Specified by:
methodNotAllowed
in interfaceRestResponse
-
notAcceptable
- Specified by:
notAcceptable
in interfaceRestResponse
-
conflict
- Specified by:
conflict
in interfaceRestResponse
-
preconditionFailed
- Specified by:
preconditionFailed
in interfaceRestResponse
-
unsupportedMediaType
- Specified by:
unsupportedMediaType
in interfaceRestResponse
-
internalServerError
- Specified by:
internalServerError
in interfaceRestResponse
-
getStatus
public int getStatus()- Specified by:
getStatus
in interfaceRestResponse
-
setStatus
- Specified by:
setStatus
in interfaceRestResponse
-
setStatus
- Specified by:
setStatus
in interfaceRestResponse
-
setHeader
Description copied from interface:RestResponse
Set the given single header value under the given header name.- Specified by:
setHeader
in interfaceRestResponse
- Parameters:
name
- the header namevalue
- the header value to set
-
addHeader
Description copied from interface:RestResponse
Add the given single header value to the current list of values for the given header.- Specified by:
addHeader
in interfaceRestResponse
- Parameters:
name
- the header namevalue
- the header value to be added
-
getHeaders
-
getSupportedContentTypes
-
getContentTypeByPathExtension
-
determineEncoding
-
determineContentType
protected MediaType determineContentType(@NonNull Activity activity) throws HttpMediaTypeNotAcceptableException
-