Package org.apache.juneau.rest
Class RestOpContext
java.lang.Object
org.apache.juneau.Context
org.apache.juneau.rest.RestOpContext
- All Implemented Interfaces:
- Comparable<RestOpContext>,- AnnotationProvider
- Direct Known Subclasses:
- RrpcRestOpContext
Represents a single Java servlet/resource method annotated with 
@RestOp.
 Notes:
- This class is thread safe and reusable.
See Also:
- 
Nested Class SummaryNested Classes
- 
Field SummaryFields inherited from class org.apache.juneau.ContextCONTEXT_APPLY_FILTERFields inherited from interface org.apache.juneau.AnnotationProviderDEFAULT, DISABLE_ANNOTATION_CACHING
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedRestOpContext(RestOpContext.Builder builder) Context constructor.
- 
Method SummaryModifier and TypeMethodDescriptionintcopy()Creates a builder from this context object.static RestOpContext.Buildercreate(Method method, RestContext context) Creates a new builder for this object.createRequest(RestSession session) Creates aRestRequestobject based on the specified incomingHttpServletRequestobject.createResponse(RestSession session, RestRequest req) Creates aRestResponseobject based on the specified incomingHttpServletResponseobject and the request returned bycreateRequest(RestSession).createSession(RestSession session) Creates a new REST operation session.booleanReturns the bean context associated with this context.Returns the default charset.Returns the default request attributes.Returns the default form data parameters.Returns the default request headers.Returns the default request query parameters.Returns the default response headers.Returns the compression encoders to use for this method.Returns the HTTP method name (e.g.Returns the underlying Java method that this context belongs to.Returns the JSON-Schema generator applicable to this Java method.longReturns the max number of bytes to process in the input content.Returns the parsers to use for this method.Bean property getter:partParser .Bean property getter:partSerializer .Returns the path pattern for this method.Returns metadata about the specified response object if it's annotated with@Response.Returns metadata about the specified response object if it's annotated with@Header.Returns the response bean meta if this method returns aResponse-annotated bean.Returns the serializers to use for this method.Returns a list of supported accept types.Returns the list of supported content types.inthashCode()protected intmatch(RestSession session) Identifies if this method can process the specified call.protected JsonMapReturns the properties on this bean as a map for debugging.Methods inherited from class org.apache.juneau.ContextcreateBuilder, createSession, firstAnnotation, firstAnnotation, firstAnnotation, firstAnnotation, firstDeclaredAnnotation, forEachAnnotation, forEachAnnotation, forEachAnnotation, forEachAnnotation, forEachDeclaredAnnotation, getSession, hasAnnotation, hasAnnotation, hasAnnotation, hasAnnotation, init, isDebug, lastAnnotation, lastAnnotation, lastAnnotation, lastAnnotation, lastDeclaredAnnotation, toString
- 
Constructor Details- 
RestOpContextContext constructor.- Parameters:
- builder- The builder for this object.
- Throws:
- jakarta.servlet.ServletException- If context could not be created.
 
 
- 
- 
Method Details- 
createCreates a new builder for this object.- Parameters:
- method- The Java method this context belongs to.
- context- The Java class context.
- Returns:
- A new builder.
 
- 
createSessionCreates a new REST operation session.- Parameters:
- session- The REST session.
- Returns:
- A new REST operation session.
- Throws:
- Exception- If op session could not be created.
 
- 
createRequestCreates aRestRequestobject based on the specified incomingHttpServletRequestobject.- Parameters:
- session- The current REST call.
- Returns:
- The wrapped request object.
- Throws:
- Exception- If any errors occur trying to interpret the request.
 
- 
createResponseCreates aRestResponseobject based on the specified incomingHttpServletResponseobject and the request returned bycreateRequest(RestSession).- Parameters:
- session- The current REST call.
- req- The REST request.
- Returns:
- The wrapped response object.
- Throws:
- Exception- If any errors occur trying to interpret the request or response.
 
- 
getBeanContextReturns the bean context associated with this context.- Returns:
- The bean context associated with this context.
 
- 
getResponseBeanMetaReturns metadata about the specified response object if it's annotated with@Response.- Parameters:
- o- The response POJO.
- Returns:
- Metadata about the specified response object, or null if it's not annotated with@Response.
 
- 
getResponseHeaderMetaReturns metadata about the specified response object if it's annotated with@Header.- Parameters:
- o- The response POJO.
- Returns:
- Metadata about the specified response object, or null if it's not annotated with@Header.
 
- 
getHttpMethodReturns the HTTP method name (e.g."GET" ).- Returns:
- The HTTP method name.
 
- 
getPathPatternReturns the path pattern for this method.- Returns:
- The path pattern.
 
- 
getSerializersReturns the serializers to use for this method.- Returns:
- The serializers to use for this method.
 
- 
getParsersReturns the parsers to use for this method.- Returns:
- The parsers to use for this method.
 
- 
getEncodersReturns the compression encoders to use for this method.- Returns:
- The compression encoders to use for this method.
 
- 
getPartSerializerBean property getter:partSerializer .- Returns:
- The value of the partSerializer property on this bean, ornull if it is not set.
 
- 
getPartParserBean property getter:partParser .- Returns:
- The value of the partParser property on this bean, ornull if it is not set.
 
- 
getJsonSchemaGeneratorReturns the JSON-Schema generator applicable to this Java method.- Returns:
- The JSON-Schema generator applicable to this Java method.
 
- 
getJavaMethodReturns the underlying Java method that this context belongs to.- Returns:
- The underlying Java method that this context belongs to.
 
- 
getDefaultRequestHeadersReturns the default request headers.- Returns:
- The default request headers.  Never null .
 
- 
getDefaultResponseHeadersReturns the default response headers.- Returns:
- The default response headers.  Never null .
 
- 
getDefaultRequestQueryDataReturns the default request query parameters.- Returns:
- The default request query parameters.  Never null .
 
- 
getDefaultRequestFormDataReturns the default form data parameters.- Returns:
- The default form data parameters.  Never null .
 
- 
getDefaultRequestAttributesReturns the default request attributes.- Returns:
- The default request attributes.  Never null .
 
- 
getDefaultCharsetReturns the default charset.- Returns:
- The default charset.  Never null .
 
- 
getMaxInputReturns the max number of bytes to process in the input content.- Returns:
- The max number of bytes to process in the input content.
 
- 
getSupportedContentTypesReturns the list of supported content types.- Returns:
- An unmodifiable list.
 
- 
getSupportedAcceptTypesReturns a list of supported accept types.- Returns:
- An unmodifiable list.
 
- 
getResponseMetaReturns the response bean meta if this method returns aResponse-annotated bean.- Returns:
- The response bean meta or null if it's not aResponse-annotated bean.
 
- 
matchIdentifies if this method can process the specified call.To process the call, the following must be true: - Path pattern must match.
- Matchers (if any) must match.
 - Parameters:
- session- The call to check.
- Returns:
- One of the following values:
   - 0 - Path doesn't match.
- 1 - Path matched but matchers did not.
- 2 - Matches.
 
 
- 
copyDescription copied from class:ContextCreates a builder from this context object.Builders are used to define new contexts (e.g. serializers, parsers) based on existing configurations. 
- 
compareTo- Specified by:
- compareToin interface- Comparable<RestOpContext>
 
- 
equals
- 
hashCode
- 
propertiesDescription copied from class:ContextReturns the properties on this bean as a map for debugging.- Overrides:
- propertiesin class- Context
- Returns:
- The properties on this bean as a map for debugging.
 
 
-