@ConfigurableContext(nocache=true) public class RestMethodContext extends BeanContext implements Comparable<RestMethodContext>
@RestMethod
.Modifier and Type | Field and Description |
---|---|
static String |
RESTMETHOD_attrs
Deprecated.
|
static String |
RESTMETHOD_callLoggerConfig
Configuration property: Logging rules.
|
static String |
RESTMETHOD_clientVersion
Configuration property: Client version pattern matcher.
|
static String |
RESTMETHOD_debug
Configuration property: Debug mode.
|
static String |
RESTMETHOD_defaultFormData
Configuration property: Default form data.
|
static String |
RESTMETHOD_defaultQuery
Configuration property: Default query parameters.
|
static String |
RESTMETHOD_defaultRequestHeaders
Deprecated.
|
static String |
RESTMETHOD_httpMethod
Configuration property: HTTP method name.
|
static String |
RESTMETHOD_matchers
Configuration property: Method-level matchers.
|
static String |
RESTMETHOD_path
Deprecated.
Use
RESTMETHOD_paths |
static String |
RESTMETHOD_paths
Configuration property: Resource method paths.
|
static String |
RESTMETHOD_priority
Configuration property: Priority.
|
static String |
RESTMETHOD_reqAttrs
Configuration property: Default request attributes.
|
static String |
RESTMETHOD_reqHeaders
Configuration property: Default request headers.
|
BEAN_annotations, BEAN_beanClassVisibility, BEAN_beanConstructorVisibility, BEAN_beanDictionary, BEAN_beanDictionary_add, BEAN_beanDictionary_remove, BEAN_beanFieldVisibility, BEAN_beanFilters, BEAN_beanFilters_add, BEAN_beanFilters_remove, BEAN_beanMapPutReturnsOldValue, BEAN_beanMethodVisibility, BEAN_beansRequireDefaultConstructor, BEAN_beansRequireSerializable, BEAN_beansRequireSettersForGetters, BEAN_beansRequireSomeProperties, BEAN_bpi, BEAN_bpro, BEAN_bpwo, BEAN_bpx, BEAN_examples, BEAN_excludeProperties, BEAN_fluentSetters, BEAN_ignoreInvocationExceptionsOnGetters, BEAN_ignoreInvocationExceptionsOnSetters, BEAN_ignorePropertiesWithoutSetters, BEAN_ignoreTransientFields, BEAN_ignoreUnknownBeanProperties, BEAN_ignoreUnknownNullBeanProperties, BEAN_implClasses, BEAN_includeProperties, BEAN_notBeanClasses, BEAN_notBeanClasses_add, BEAN_notBeanClasses_remove, BEAN_notBeanPackages, BEAN_notBeanPackages_add, BEAN_notBeanPackages_remove, BEAN_pojoSwaps, BEAN_pojoSwaps_add, BEAN_pojoSwaps_remove, BEAN_propertyNamer, BEAN_sortProperties, BEAN_swaps, BEAN_swaps_add, BEAN_swaps_remove, BEAN_typePropertyName, BEAN_useEnumNames, BEAN_useInterfaceProxies, BEAN_useJavaBeanIntrospector, DEFAULT, DEFAULT_SORTED
CONTEXT_debug, CONTEXT_locale, CONTEXT_mediaType, CONTEXT_timeZone
Modifier and Type | Method and Description |
---|---|
int |
compareTo(RestMethodContext o) |
boolean |
equals(Object o) |
protected RestCallLoggerConfig |
getCallLoggerConfig() |
JsonSchemaGenerator |
getJsonSchemaGenerator()
Returns the JSON-Schema generator applicable to this Java method.
|
ParserGroup |
getParsers()
Bean property getter:
|
HttpPartParser |
getPartParser()
Bean property getter:
|
HttpPartSerializer |
getPartSerializer()
Bean property getter:
|
SerializerGroup |
getSerializers()
Bean property getter:
|
int |
hashCode() |
protected int |
match(RestCall call)
Identifies if this method can process the specified call.
|
OMap |
toMap()
Returns the properties defined on this bean context as a simple map for debugging purposes.
|
_class, builder, create, createBeanSession, createBeanSession, createDefaultBeanSessionArgs, createDefaultSessionArgs, createSession, createSession, createSession, dumpCacheStats, getAnnotations, getAnnotations, getAnnotations, getAnnotations, getAnnotations, getAnnotations, getAnnotations, getAnnotations, getBeanClassVisibility, getBeanConstructorVisibility, getBeanDictionaryClasses, getBeanFieldVisibility, getBeanFilters, getBeanMeta, getBeanMethodVisibility, getBeanRegistry, getBeanToStringSerializer, getBeanTypePropertyName, getBpi, getBpi, getBpro, getBpro, getBpwo, getBpwo, getBpx, getBpx, getClassMeta, getClassMeta, getClassMetaForObject, getDeclaredAnnotations, getDeclaredAnnotations, getExamples, getImplClassConstructor, getImplClasses, getLastAnnotation, getLastAnnotation, getLastAnnotation, getLastAnnotation, getLastAnnotation, getLastAnnotation, getLastAnnotation, getLastAnnotation, getLastDeclaredAnnotation, getLastDeclaredAnnotation, getNotBeanClasses, getNotBeanPackagesNames, getNotBeanPackagesPrefixes, getPropertyNamer, getSwaps, hasAnnotation, hasAnnotation, hasAnnotation, hasAnnotation, hasAnnotation, hasAnnotation, hasAnnotation, hasAnnotation, hasDeclaredAnnotation, hasDeclaredAnnotation, hasSameCache, isBean, isBeanMapPutReturnsOldValue, isBeansRequireDefaultConstructor, isBeansRequireSerializable, isBeansRequireSettersForGetters, isBeansRequireSomeProperties, isFluentSetters, isIgnoreInvocationExceptionsOnGetters, isIgnoreInvocationExceptionsOnSetters, isIgnorePropertiesWithoutSetters, isIgnoreTransientFields, isIgnoreUnknownBeanProperties, isIgnoreUnknownNullBeanProperties, isNotABean, isSortProperties, isUseEnumNames, isUseInterfaceProxies, isUseJavaBeanIntrospector, object, resolveClassMeta, string
getArrayProperty, getArrayProperty, getBooleanProperty, getCdlProperty, getClassArrayProperty, getClassArrayProperty, getClassArrayProperty, getClassListProperty, getClassListProperty, getClassMapProperty, getClassMapProperty, getClassProperty, getClassSetProperty, getClassSetProperty, getDefaultLocale, getDefaultMediaType, getDefaultTimeZone, getInstanceArrayProperty, getInstanceArrayProperty, getInstanceArrayProperty, getInstanceProperty, getInstanceProperty, getInstanceProperty, getIntegerProperty, getListProperty, getListProperty, getLongProperty, getMapProperty, getProperty, getProperty, getPropertyKeys, getPropertyStore, getSetProperty, getSetProperty, getStringProperty, getStringPropertyWithNone, identityCode, isDebug, toString
@Deprecated public static final String RESTMETHOD_attrs
RESTMETHOD_reqAttrs
public static final String RESTMETHOD_clientVersion
RESTMETHOD_clientVersion
The client version is identified via the HTTP request header identified by
@Rest(clientVersionHeader)
which by default is
This is a specialized kind of RestMatcher
that allows you to invoke different Java methods for the same
method/path based on the client version.
The format of the client version range is similar to that of OSGi versions.
In the following example, the Java methods are mapped to the same HTTP method and URL
It's common to combine the client version with transforms that will convert new POJOs into older POJOs for backwards compatibility.
Note that in the previous example, we're returning the exact same POJO, but using a transform to convert it into an older form. The old method could also just return back a completely different object. The range can be any of the following:
public static final String RESTMETHOD_debug
RESTMETHOD_debug
Enablement
Enablement.FALSE
Enables the following:
public static final String RESTMETHOD_defaultFormData
RESTMETHOD_defaultFormData
Strings are of the format
Affects values returned by RestRequest.getFormData(String)
when the parameter is not present on the
request.
public static final String RESTMETHOD_defaultQuery
RESTMETHOD_defaultQuery
Strings are of the format
Affects values returned by RestRequest.getQuery(String)
when the parameter is not present on the request.
@Deprecated public static final String RESTMETHOD_defaultRequestHeaders
RESTMETHOD_defaultRequestHeaders
public static final String RESTMETHOD_httpMethod
RESTMETHOD_httpMethod
Typically
Method names are case-insensitive (always folded to upper-case).
Note that you can use HttpMethod
for constant values.
Besides the standard HTTP method names, the following can also be specified:
@Method
annotation and/or RestRequest.getMethod()
method can be used to
distinguish the actual HTTP method name.
@Remote
annotation) to be used as a remote proxy using
public static final String RESTMETHOD_callLoggerConfig
RESTMETHOD_callLoggerConfig
RestCallLoggerConfig
Specifies rules on how to handle logging of HTTP requests/responses.
public static final String RESTMETHOD_matchers
RESTMETHOD_matchers
RestMatcher
|Class<RestMatcher
>>
Associates one or more RestMatchers
with the specified method.
If multiple matchers are specified, ONE matcher must pass.
Note that this is different than guards where ALL guards needs to pass.
public T(RestContext)
public T()
public static T create (RestContext)
public static T create ()
@Deprecated public static final String RESTMETHOD_path
RESTMETHOD_paths
RESTMETHOD_path
Identifies the URL subpath relative to the servlet class.
public static final String RESTMETHOD_paths
RESTMETHOD_paths
Identifies the URL subpath relative to the servlet class.
public static final String RESTMETHOD_priority
RESTMETHOD_priority
To force path patterns to be checked before other path patterns, use a higher priority number.
By default, it's
public static final String RESTMETHOD_reqAttrs
RESTMETHOD_reqAttrs
Specifies default values for request attributes if they are not already set on the request.
public static final String RESTMETHOD_reqHeaders
RESTMETHOD_reqHeaders
Specifies default values for request headers if they're not passed in through the request.
protected int match(RestCall call)
To process the call, the following must be true:
call
- The call to check.public int compareTo(RestMethodContext o)
compareTo
in interface Comparable<RestMethodContext>
public SerializerGroup getSerializers()
public ParserGroup getParsers()
public HttpPartSerializer getPartSerializer()
public HttpPartParser getPartParser()
public JsonSchemaGenerator getJsonSchemaGenerator()
protected RestCallLoggerConfig getCallLoggerConfig()
public OMap toMap()
Context
toMap
in class BeanContext
Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.