@ConfigurableContext(nocache=true) public class RestMethodContext extends BeanContext implements Comparable<RestMethodContext>
@RestMethod
.Modifier and Type | Field and Description |
---|---|
static String |
RESTMETHOD_attrs
Configuration property: Default request attributes.
|
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
Configuration property: Default request headers.
|
static String |
RESTMETHOD_httpMethod
Configuration property: HTTP method name.
|
static String |
RESTMETHOD_matchers
Configuration property: Method-level matchers.
|
static String |
RESTMETHOD_path
Configuration property: Resource method path.
|
static String |
RESTMETHOD_priority
Configuration property: Priority.
|
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_beanTypePropertyName, BEAN_debug, BEAN_examples, BEAN_excludeProperties, BEAN_fluentSetters, BEAN_ignoreInvocationExceptionsOnGetters, BEAN_ignoreInvocationExceptionsOnSetters, BEAN_ignorePropertiesWithoutSetters, BEAN_ignoreUnknownBeanProperties, BEAN_ignoreUnknownNullBeanProperties, BEAN_implClasses, BEAN_includeProperties, BEAN_locale, BEAN_mediaType, 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_timeZone, BEAN_useEnumNames, BEAN_useInterfaceProxies, BEAN_useJavaBeanIntrospector, DEFAULT, DEFAULT_SORTED
Modifier and Type | Method and Description |
---|---|
int |
compareTo(RestMethodContext o) |
boolean |
equals(Object o) |
protected RestCallLoggerConfig |
getCallLoggerConfig() |
protected Enablement |
getDebug()
Returns whether debug is enabled on this method.
|
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() |
ObjectMap |
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, getBeanClassVisibility, getBeanConstructorVisibility, getBeanDictionaryClasses, getBeanFieldVisibility, getBeanFilters, getBeanMeta, getBeanMethodVisibility, getBeanRegistry, getBeanTypePropertyName, getClassMeta, getClassMeta, getClassMetaForObject, getExamples, getExcludeProperties, getExcludeProperties, getImplClassConstructor, getImplClasses, getIncludeProperties, getIncludeProperties, getLocale, getMediaType, getNotBeanClasses, getNotBeanPackagesNames, getNotBeanPackagesPrefixes, getPojoSwaps, getPropertyNamer, getTimeZone, hasSameCache, isBean, isBeanMapPutReturnsOldValue, isBeansRequireDefaultConstructor, isBeansRequireSerializable, isBeansRequireSettersForGetters, isBeansRequireSomeProperties, isDebug, isFluentSetters, isIgnoreInvocationExceptionsOnGetters, isIgnoreInvocationExceptionsOnSetters, isIgnorePropertiesWithoutSetters, isIgnoreUnknownBeanProperties, isIgnoreUnknownNullBeanProperties, isNotABean, isSortProperties, isUseEnumNames, isUseInterfaceProxies, isUseJavaBeanIntrospector, object, resolveClassMeta, string
getArrayProperty, getArrayProperty, getBooleanProperty, getCdlProperty, getClassArrayProperty, getClassArrayProperty, getClassArrayProperty, getClassListProperty, getClassListProperty, getClassMapProperty, getClassMapProperty, getClassProperty, getClassSetProperty, getClassSetProperty, getInstanceArrayProperty, getInstanceArrayProperty, getInstanceArrayProperty, getInstanceProperty, getInstanceProperty, getInstanceProperty, getIntegerProperty, getListProperty, getListProperty, getLongProperty, getMapProperty, getProperty, getProperty, getPropertyKeys, getPropertyStore, getSetProperty, getSetProperty, getStringProperty, getStringPropertyWithNone, identityCode, toString
public static final String RESTMETHOD_attrs
Specifies default values for request attributes if they are not already set on the request.
public static final String RESTMETHOD_clientVersion
The client version is identified via the HTTP request header identified by
@RestResource(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
Enablement
Enablement.FALSE
Enables the following:
public static final String 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
Strings are of the format
Affects values returned by RestRequest.getQuery(String)
when the parameter is not present on the request.
public static final String RESTMETHOD_defaultRequestHeaders
Specifies default values for request headers if they're not passed in through the request.
public static final String RESTMETHOD_httpMethod
Typically
Method names are case-insensitive (always folded to upper-case).
Note that you can use HttpMethodName
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.
@RemoteInterface
annotation) to be used as a remote proxy using
public static final String RESTMETHOD_callLoggerConfig
RestCallLoggerConfig
Specifies rules on how to handle logging of HTTP requests/responses.
public static final String RESTMETHOD_matchers
List<RestMatcher
| Class<? extends 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 static final String RESTMETHOD_path
Identifies the URL subpath relative to the servlet class.
public static final String RESTMETHOD_priority
To force path patterns to be checked before other path patterns, use a higher priority number.
By default, it's
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 Enablement getDebug()
protected RestCallLoggerConfig getCallLoggerConfig()
public ObjectMap toMap()
Context
toMap
in class BeanContext
Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.