Class AbstractRestResponse
- java.lang.Object
-
- com.aspectran.web.activity.response.AbstractRestResponse
-
- All Implemented Interfaces:
com.aspectran.core.activity.response.transform.CustomTransformer,RestResponse
- Direct Known Subclasses:
DefaultRestResponse
public abstract class AbstractRestResponse extends java.lang.Object implements RestResponse
Abstract class shared by RestResponse.Created: 2019-06-16
-
-
Constructor Summary
Constructors Constructor Description AbstractRestResponse()AbstractRestResponse(java.lang.Object data)AbstractRestResponse(java.lang.String name, java.lang.Object data)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description RestResponseaccepted()RestResponsebadRequest()RestResponseconflict()RestResponsecreated()RestResponsecreated(java.lang.String location)RestResponsedefaultContentType(MediaType defaultContentType)protected MediaTypedetermineContentType(com.aspectran.core.activity.Activity activity)protected java.lang.StringdetermineEncoding(com.aspectran.core.activity.Activity activity)RestResponsefavorPathExtension(boolean favorPathExtension)RestResponseforbidden()protected abstract MediaTypegetContentTypeByPathExtension(java.lang.String extension)java.lang.ObjectgetData()MediaTypegetDefaultContentType()java.lang.StringgetLocation()java.lang.StringgetName()intgetStatus()protected abstract java.util.List<MediaType>getSupportedContentTypes()RestResponseignoreAcceptHeader(boolean ignoreAcceptHeader)RestResponseignoreUnknownPathExtensions(boolean ignoreUnknownPathExtensions)RestResponseinternalServerError()booleanisFavorPathExtension()booleanisIgnoreAcceptHeader()booleanisIgnoreUnknownPathExtensions()booleanisPrettyPrint()RestResponsemethodNotAllowed()RestResponsemovedPermanently()RestResponsenoContent()RestResponsenotAcceptable()RestResponsenotFound()RestResponsenotModified()RestResponseok()RestResponsepreconditionFailed()RestResponseprettyPrint(boolean prettyPrint)RestResponseseeOther()voidsetData(java.lang.Object data)Specifies response data.voidsetData(java.lang.String name, java.lang.Object data)Specifies response data with a name.voidsetDefaultContentType(MediaType defaultContentType)voidsetDefaultContentType(java.lang.String defaultContentType)voidsetFavorPathExtension(boolean favorPathExtension)voidsetIgnoreAcceptHeader(boolean ignoreAcceptHeader)voidsetIgnoreUnknownPathExtensions(boolean ignoreUnknownPathExtensions)voidsetPrettyPrint(boolean prettyPrint)Sets whether to apply indentations and line breaks when generating response data.voidsetStatus(int status)voidsetStatus(HttpStatus status)RestResponsetemporaryRedirect()RestResponseunauthorized()RestResponseunsupportedMediaType()
-
-
-
Method Detail
-
getName
public java.lang.String getName()
- Specified by:
getNamein interfaceRestResponse
-
getData
public java.lang.Object getData()
- Specified by:
getDatain interfaceRestResponse
-
setData
public void setData(java.lang.Object data)
Description copied from interface:RestResponseSpecifies response data.- Specified by:
setDatain interfaceRestResponse- Parameters:
data- the response data
-
setData
public void setData(java.lang.String name, java.lang.Object data)Description copied from interface:RestResponseSpecifies response data with a name.- Specified by:
setDatain interfaceRestResponse- Parameters:
name- the name of the response datadata- the response data
-
isPrettyPrint
public boolean isPrettyPrint()
- Specified by:
isPrettyPrintin interfaceRestResponse
-
setPrettyPrint
public void setPrettyPrint(boolean prettyPrint)
Description copied from interface:RestResponseSets whether to apply indentations and line breaks when generating response data.- Specified by:
setPrettyPrintin interfaceRestResponse- Parameters:
prettyPrint- true if responding with indentations and line breaks; otherwise false
-
prettyPrint
public RestResponse prettyPrint(boolean prettyPrint)
- Specified by:
prettyPrintin interfaceRestResponse
-
isFavorPathExtension
public boolean isFavorPathExtension()
- Specified by:
isFavorPathExtensionin interfaceRestResponse
-
setFavorPathExtension
public void setFavorPathExtension(boolean favorPathExtension)
- Specified by:
setFavorPathExtensionin interfaceRestResponse
-
favorPathExtension
public RestResponse favorPathExtension(boolean favorPathExtension)
- Specified by:
favorPathExtensionin interfaceRestResponse
-
isIgnoreUnknownPathExtensions
public boolean isIgnoreUnknownPathExtensions()
- Specified by:
isIgnoreUnknownPathExtensionsin interfaceRestResponse
-
setIgnoreUnknownPathExtensions
public void setIgnoreUnknownPathExtensions(boolean ignoreUnknownPathExtensions)
- Specified by:
setIgnoreUnknownPathExtensionsin interfaceRestResponse
-
ignoreUnknownPathExtensions
public RestResponse ignoreUnknownPathExtensions(boolean ignoreUnknownPathExtensions)
- Specified by:
ignoreUnknownPathExtensionsin interfaceRestResponse
-
isIgnoreAcceptHeader
public boolean isIgnoreAcceptHeader()
- Specified by:
isIgnoreAcceptHeaderin interfaceRestResponse
-
setIgnoreAcceptHeader
public void setIgnoreAcceptHeader(boolean ignoreAcceptHeader)
- Specified by:
setIgnoreAcceptHeaderin interfaceRestResponse
-
ignoreAcceptHeader
public RestResponse ignoreAcceptHeader(boolean ignoreAcceptHeader)
- Specified by:
ignoreAcceptHeaderin interfaceRestResponse
-
getDefaultContentType
public MediaType getDefaultContentType()
- Specified by:
getDefaultContentTypein interfaceRestResponse
-
setDefaultContentType
public void setDefaultContentType(MediaType defaultContentType)
- Specified by:
setDefaultContentTypein interfaceRestResponse
-
setDefaultContentType
public void setDefaultContentType(java.lang.String defaultContentType)
- Specified by:
setDefaultContentTypein interfaceRestResponse
-
defaultContentType
public RestResponse defaultContentType(MediaType defaultContentType)
- Specified by:
defaultContentTypein interfaceRestResponse
-
ok
public RestResponse ok()
- Specified by:
okin interfaceRestResponse
-
created
public RestResponse created()
- Specified by:
createdin interfaceRestResponse
-
created
public RestResponse created(java.lang.String location)
- Specified by:
createdin interfaceRestResponse
-
accepted
public RestResponse accepted()
- Specified by:
acceptedin interfaceRestResponse
-
noContent
public RestResponse noContent()
- Specified by:
noContentin interfaceRestResponse
-
movedPermanently
public RestResponse movedPermanently()
- Specified by:
movedPermanentlyin interfaceRestResponse
-
seeOther
public RestResponse seeOther()
- Specified by:
seeOtherin interfaceRestResponse
-
notModified
public RestResponse notModified()
- Specified by:
notModifiedin interfaceRestResponse
-
temporaryRedirect
public RestResponse temporaryRedirect()
- Specified by:
temporaryRedirectin interfaceRestResponse
-
badRequest
public RestResponse badRequest()
- Specified by:
badRequestin interfaceRestResponse
-
unauthorized
public RestResponse unauthorized()
- Specified by:
unauthorizedin interfaceRestResponse
-
forbidden
public RestResponse forbidden()
- Specified by:
forbiddenin interfaceRestResponse
-
notFound
public RestResponse notFound()
- Specified by:
notFoundin interfaceRestResponse
-
methodNotAllowed
public RestResponse methodNotAllowed()
- Specified by:
methodNotAllowedin interfaceRestResponse
-
notAcceptable
public RestResponse notAcceptable()
- Specified by:
notAcceptablein interfaceRestResponse
-
conflict
public RestResponse conflict()
- Specified by:
conflictin interfaceRestResponse
-
preconditionFailed
public RestResponse preconditionFailed()
- Specified by:
preconditionFailedin interfaceRestResponse
-
unsupportedMediaType
public RestResponse unsupportedMediaType()
- Specified by:
unsupportedMediaTypein interfaceRestResponse
-
internalServerError
public RestResponse internalServerError()
- Specified by:
internalServerErrorin interfaceRestResponse
-
getStatus
public int getStatus()
- Specified by:
getStatusin interfaceRestResponse
-
setStatus
public void setStatus(int status)
- Specified by:
setStatusin interfaceRestResponse
-
setStatus
public void setStatus(HttpStatus status)
- Specified by:
setStatusin interfaceRestResponse
-
getLocation
public java.lang.String getLocation()
- Specified by:
getLocationin interfaceRestResponse
-
getSupportedContentTypes
protected abstract java.util.List<MediaType> getSupportedContentTypes()
-
getContentTypeByPathExtension
protected abstract MediaType getContentTypeByPathExtension(java.lang.String extension)
-
determineEncoding
protected java.lang.String determineEncoding(com.aspectran.core.activity.Activity activity)
-
determineContentType
protected MediaType determineContentType(com.aspectran.core.activity.Activity activity) throws HttpMediaTypeNotAcceptableException
-
-