Package org.apache.juneau.rest.servlet
Class BasicRestObject
java.lang.Object
org.apache.juneau.rest.servlet.RestObject
org.apache.juneau.rest.servlet.BasicRestObject
- All Implemented Interfaces:
BasicUniversalConfig
,DefaultConfig
,DefaultHtmlConfig
,BasicRestOperations
- Direct Known Subclasses:
BasicRestObjectGroup
,HelloWorldResource
,HtmlBeansResource
,RequestEchoResource
,UtilityBeansResource
public abstract class BasicRestObject
extends RestObject
implements BasicRestOperations, BasicUniversalConfig
Identical to
BasicRestServlet
but doesn't extend from HttpServlet
.
Meant as a base class for child REST resources in servlet containers and Spring Boot environments.
Provides support for JSON, XML, HTML, URL-Encoding, UON, XML, OpenAPI, and MessagePack. See BasicUniversalConfig
for details.
Implements the basic REST endpoints defined in BasicRestOperations
.
See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
error()
[* /error] - Error occurred.[GET favicon.ico] - Retrieve favorites icon image.[GET /htdocs/*] - Retrieve static file.getStats
(RestRequest req) [GET /stats] - Timing statistics.getSwagger
(RestRequest req) [GET /api] - Show resource options.Methods inherited from class org.apache.juneau.rest.servlet.RestObject
doLog, getContext, getRequest, getResponse, log, log, setContext
-
Constructor Details
-
BasicRestObject
public BasicRestObject()
-
-
Method Details
-
getSwagger
Description copied from interface:BasicRestOperations
[GET /api] - Show resource options.- Specified by:
getSwagger
in interfaceBasicRestOperations
- Parameters:
req
- The HTTP request.- Returns:
- A bean containing the contents for the OPTIONS page.
-
getHtdoc
Description copied from interface:BasicRestOperations
[GET /htdocs/*] - Retrieve static file.- Specified by:
getHtdoc
in interfaceBasicRestOperations
- Parameters:
path
- The path to retrieve.locale
- The locale of the HTTP request.- Returns:
- An HTTP resource representing the static file.
- Throws:
NotFound
-
getFavIcon
Description copied from interface:BasicRestOperations
[GET favicon.ico] - Retrieve favorites icon image.- Specified by:
getFavIcon
in interfaceBasicRestOperations
- Returns:
- A bean containing the contents for the OPTIONS page.
-
error
Description copied from interface:BasicRestOperations
[* /error] - Error occurred.- Specified by:
error
in interfaceBasicRestOperations
-
getStats
Description copied from interface:BasicRestOperations
[GET /stats] - Timing statistics.Timing statistics for method invocations on this resource.
- Specified by:
getStats
in interfaceBasicRestOperations
- Parameters:
req
- The HTTP request.- Returns:
- A collection of timing statistics for each annotated method on this resource.
-