Class AbstractRestResponse
- java.lang.Object
-
- com.aspectran.web.activity.response.AbstractRestResponse
-
- All Implemented Interfaces:
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
-
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
-
-
-
-
Method Detail
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceRestResponse
-
getData
public java.lang.Object getData()
- Specified by:
getData
in interfaceRestResponse
-
setData
public RestResponse setData(java.lang.Object data)
Description copied from interface:RestResponse
Specifies response data.- Specified by:
setData
in interfaceRestResponse
- Parameters:
data
- the response data
-
setData
public RestResponse setData(java.lang.String name, java.lang.Object data)
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
public RestResponse prettyPrint(boolean 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
public RestResponse favorPathExtension(boolean 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
public RestResponse ignoreUnknownPathExtensions(boolean 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
public RestResponse ignoreAcceptHeader(boolean ignoreAcceptHeader)
- Specified by:
ignoreAcceptHeader
in interfaceRestResponse
-
getDefaultContentType
public MediaType getDefaultContentType()
- Specified by:
getDefaultContentType
in interfaceRestResponse
-
setDefaultContentType
public void setDefaultContentType(MediaType defaultContentType)
- Specified by:
setDefaultContentType
in interfaceRestResponse
-
setDefaultContentType
public void setDefaultContentType(java.lang.String defaultContentType)
- Specified by:
setDefaultContentType
in interfaceRestResponse
-
defaultContentType
public RestResponse defaultContentType(MediaType defaultContentType)
- Specified by:
defaultContentType
in interfaceRestResponse
-
ok
public RestResponse ok()
- Specified by:
ok
in interfaceRestResponse
-
created
public RestResponse created()
- Specified by:
created
in interfaceRestResponse
-
created
public RestResponse created(java.lang.String location)
- Specified by:
created
in interfaceRestResponse
-
accepted
public RestResponse accepted()
- Specified by:
accepted
in interfaceRestResponse
-
noContent
public RestResponse noContent()
- Specified by:
noContent
in interfaceRestResponse
-
movedPermanently
public RestResponse movedPermanently()
- Specified by:
movedPermanently
in interfaceRestResponse
-
seeOther
public RestResponse seeOther()
- Specified by:
seeOther
in interfaceRestResponse
-
notModified
public RestResponse notModified()
- Specified by:
notModified
in interfaceRestResponse
-
temporaryRedirect
public RestResponse temporaryRedirect()
- Specified by:
temporaryRedirect
in interfaceRestResponse
-
badRequest
public RestResponse badRequest()
- Specified by:
badRequest
in interfaceRestResponse
-
unauthorized
public RestResponse unauthorized()
- Specified by:
unauthorized
in interfaceRestResponse
-
forbidden
public RestResponse forbidden()
- Specified by:
forbidden
in interfaceRestResponse
-
notFound
public RestResponse notFound()
- Specified by:
notFound
in interfaceRestResponse
-
methodNotAllowed
public RestResponse methodNotAllowed()
- Specified by:
methodNotAllowed
in interfaceRestResponse
-
notAcceptable
public RestResponse notAcceptable()
- Specified by:
notAcceptable
in interfaceRestResponse
-
conflict
public RestResponse conflict()
- Specified by:
conflict
in interfaceRestResponse
-
preconditionFailed
public RestResponse preconditionFailed()
- Specified by:
preconditionFailed
in interfaceRestResponse
-
unsupportedMediaType
public RestResponse unsupportedMediaType()
- Specified by:
unsupportedMediaType
in interfaceRestResponse
-
internalServerError
public RestResponse internalServerError()
- Specified by:
internalServerError
in interfaceRestResponse
-
getStatus
public int getStatus()
- Specified by:
getStatus
in interfaceRestResponse
-
setStatus
public void setStatus(int status)
- Specified by:
setStatus
in interfaceRestResponse
-
setStatus
public void setStatus(HttpStatus status)
- Specified by:
setStatus
in interfaceRestResponse
-
getLocation
public java.lang.String getLocation()
- Specified by:
getLocation
in interfaceRestResponse
-
getSupportedContentTypes
protected abstract java.util.List<MediaType> getSupportedContentTypes()
-
getContentTypeByPathExtension
protected abstract MediaType getContentTypeByPathExtension(java.lang.String extension)
-
determineEncoding
protected java.lang.String determineEncoding(Activity activity)
-
determineContentType
protected MediaType determineContentType(Activity activity) throws HttpMediaTypeNotAcceptableException
-
-