public class RestContextBuilder extends BeanContextBuilder implements ServletConfig
An extension of the ServletConfig
object used during servlet initialization.
Provides access to the following initialized resources:
getConfig()
- The external configuration for this resource.
getProperties()
- The modifiable configuration properties for this resource.
getVarResolverBuilder()
- The variable resolver for this resource.
Methods are provided for overriding or augmenting the information provided by the
To interact with this object, simply pass it in as a constructor argument or in an INIT hook.
psb
Modifier and Type | Method and Description |
---|---|
RestContextBuilder |
add(Map<String,Object> properties)
Adds multiple configuration properties on this object.
|
RestContextBuilder |
addTo(String name,
Object value)
Adds a value to a SET or LIST property.
|
RestContextBuilder |
addTo(String name,
String key,
Object value)
Adds or overwrites a value to a SET, LIST, or MAP property.
|
RestContextBuilder |
allowBodyParam(boolean value)
Configuration property: Allow body URL parameter.
|
RestContextBuilder |
allowedHeaderParams(String value)
Configuration property: Allowed header URL parameters.
|
RestContextBuilder |
allowedMethodHeaders(String value)
Configuration property: Allowed method headers.
|
RestContextBuilder |
allowedMethodParams(String value)
Configuration property: Allowed method parameters.
|
RestContextBuilder |
allowHeaderParams(boolean value)
Deprecated.
|
RestContextBuilder |
apply(PropertyStore copyFrom)
Copies the settings from the specified property store into this builder.
|
RestContextBuilder |
applyAnnotations(AnnotationList al,
VarResolverSession vrs)
Applies a set of annotations to this property store.
|
RestContextBuilder |
applyAnnotations(Class<?> fromClass)
Applies any of the various
|
RestContextBuilder |
applyAnnotations(Method fromMethod)
Applies any of the various
|
RestContextBuilder |
attr(String name,
Object value)
Configuration property: Default request attribute.
|
RestContextBuilder |
attrs(String... values)
Configuration property: Default request attributes.
|
RestContextBuilder |
beanClassVisibility(Visibility value)
Configuration property: Minimum bean class visibility.
|
RestContextBuilder |
beanConstructorVisibility(Visibility value)
Configuration property: Minimum bean constructor visibility.
|
RestContextBuilder |
beanDictionary(Class<?>... values)
Configuration property: Bean dictionary.
|
RestContextBuilder |
beanDictionary(Object... values)
Configuration property: Bean dictionary.
|
RestContextBuilder |
beanDictionaryRemove(Class<?>... values)
Configuration property: Bean dictionary.
|
RestContextBuilder |
beanDictionaryRemove(Object... values)
Configuration property: Bean dictionary.
|
RestContextBuilder |
beanDictionaryReplace(Class<?>... values)
Configuration property: Bean dictionary.
|
RestContextBuilder |
beanDictionaryReplace(Object... values)
Configuration property: Bean dictionary.
|
RestContextBuilder |
beanFieldVisibility(Visibility value)
Configuration property: Minimum bean field visibility.
|
RestContextBuilder |
beanFilters(Class<?>... values)
Configuration property: Bean filters.
|
RestContextBuilder |
beanFilters(Object... values)
Configuration property: Bean filters.
|
RestContextBuilder |
beanFiltersRemove(Class<?>... values)
Configuration property: Bean filters.
|
RestContextBuilder |
beanFiltersRemove(Object... values)
Configuration property: Bean filters.
|
RestContextBuilder |
beanFiltersReplace(Class<?>... values)
Configuration property: Bean filters.
|
RestContextBuilder |
beanFiltersReplace(Object... values)
Configuration property: Bean filters.
|
RestContextBuilder |
beanMapPutReturnsOldValue()
Configuration property: BeanMap.put() returns old property value.
|
RestContextBuilder |
beanMapPutReturnsOldValue(boolean value)
Configuration property: BeanMap.put() returns old property value.
|
RestContextBuilder |
beanMethodVisibility(Visibility value)
Configuration property: Minimum bean method visibility.
|
RestContextBuilder |
beansRequireDefaultConstructor()
Configuration property: Beans require no-arg constructors.
|
RestContextBuilder |
beansRequireDefaultConstructor(boolean value)
Configuration property: Beans require no-arg constructors.
|
RestContextBuilder |
beansRequireSerializable()
Configuration property: Beans require Serializable interface.
|
RestContextBuilder |
beansRequireSerializable(boolean value)
Configuration property: Beans require Serializable interface.
|
RestContextBuilder |
beansRequireSettersForGetters()
Configuration property: Beans require setters for getters.
|
RestContextBuilder |
beansRequireSettersForGetters(boolean value)
Configuration property: Beans require setters for getters.
|
RestContextBuilder |
beansRequireSomeProperties(boolean value)
Configuration property: Beans require at least one property.
|
RestContextBuilder |
beanTypePropertyName(String value)
Configuration property: Bean type property name.
|
RestContext |
build()
Build the object.
|
RestContextBuilder |
callHandler(Class<? extends RestCallHandler> value)
Configuration property: REST call handler.
|
RestContextBuilder |
callHandler(RestCallHandler value)
Configuration property: REST call handler.
|
RestContextBuilder |
callLogger(Class<? extends RestCallLogger> value)
Configuration property: REST call logger.
|
RestContextBuilder |
callLogger(RestCallLogger value)
Configuration property: REST call logger.
|
RestContextBuilder |
callLoggerConfig(RestCallLoggerConfig value)
Configuration property: REST call logging rules.
|
RestContextBuilder |
child(String path,
Object child)
Configuration property: Children.
|
RestContextBuilder |
children(Class<?>... values)
Configuration property: Children.
|
RestContextBuilder |
children(Object... values)
Configuration property: Children.
|
RestContextBuilder |
classpathResourceFinder(Class<? extends ClasspathResourceFinder> value)
Configuration property: Classpath resource finder.
|
RestContextBuilder |
classpathResourceFinder(ClasspathResourceFinder value)
Configuration property: Classpath resource finder.
|
RestContextBuilder |
clientVersionHeader(String value)
Configuration property: Client version header.
|
RestContextBuilder |
config(Config config)
Overwrites the default config file with a custom config file.
|
RestContextBuilder |
consumes(MediaType... values)
Configuration property: Supported content media types.
|
RestContextBuilder |
consumes(String... values)
Configuration property: Supported content media types.
|
RestContextBuilder |
consumesReplace(MediaType... values)
Configuration property: Supported content media types.
|
RestContextBuilder |
consumesReplace(String... values)
Configuration property: Supported content media types.
|
RestContextBuilder |
converters(Class<?>... values)
Configuration property: Class-level response converters.
|
RestContextBuilder |
converters(RestConverter... values)
Configuration property: Response converters.
|
protected PropertyStoreBuilder |
createPropertyStore()
Creates a new
PropertyStore object initialized with the properties defined in this config. |
RestContextBuilder |
debug()
Configuration property: Debug mode.
|
RestContextBuilder |
debug(boolean value)
Configuration property: Debug mode.
|
RestContextBuilder |
debug(Enablement value)
Configuration property: Debug mode.
|
RestContextBuilder |
defaultAccept(String value)
Specifies a default
|
RestContextBuilder |
defaultCharset(Charset value)
Configuration property: Default character encoding.
|
RestContextBuilder |
defaultCharset(String value)
Configuration property: Default character encoding.
|
RestContextBuilder |
defaultContentType(String value)
Specifies a default
|
RestContextBuilder |
defaultRequestHeader(String name,
Object value)
Configuration property: Default request headers.
|
RestContextBuilder |
defaultRequestHeaders(String... headers)
Configuration property: Default request headers.
|
RestContextBuilder |
defaultResponseHeader(String name,
Object value)
Configuration property: Default response headers.
|
RestContextBuilder |
defaultResponseHeaders(String... headers)
Configuration property: Default response headers.
|
RestContextBuilder |
encoders(Class<?>... values)
Configuration property: Compression encoders.
|
RestContextBuilder |
encoders(Encoder... values)
Configuration property: Compression encoders.
|
<T> RestContextBuilder |
example(Class<T> c,
T o)
Configuration property: POJO example.
|
<T> RestContextBuilder |
exampleJson(Class<T> c,
String value)
Configuration property: POJO example.
|
Config |
getConfig()
Returns the external configuration file for this resource.
|
String |
getInitParameter(String name) |
Enumeration<String> |
getInitParameterNames() |
String |
getPath()
Returns the REST path defined on this builder.
|
RestContextProperties |
getProperties()
Returns the configuration properties for this resource.
|
ServletContext |
getServletContext() |
String |
getServletName() |
VarResolverBuilder |
getVarResolverBuilder()
Creates the variable resolver for this resource.
|
RestContextBuilder |
guards(Class<?>... values)
Configuration property: Class-level guards.
|
RestContextBuilder |
guards(RestGuard... values)
Configuration property: Class-level guards.
|
RestContextBuilder |
ignoreInvocationExceptionsOnGetters()
Configuration property: Ignore invocation errors on getters.
|
RestContextBuilder |
ignoreInvocationExceptionsOnGetters(boolean value)
Configuration property: Ignore invocation errors on getters.
|
RestContextBuilder |
ignoreInvocationExceptionsOnSetters()
Configuration property: Ignore invocation errors on setters.
|
RestContextBuilder |
ignoreInvocationExceptionsOnSetters(boolean value)
Configuration property: Ignore invocation errors on setters.
|
RestContextBuilder |
ignorePropertiesWithoutSetters(boolean value)
Configuration property: Ignore properties without setters.
|
RestContextBuilder |
ignoreUnknownBeanProperties()
Configuration property: Ignore unknown properties.
|
RestContextBuilder |
ignoreUnknownBeanProperties(boolean value)
Configuration property: Ignore unknown properties.
|
RestContextBuilder |
ignoreUnknownNullBeanProperties(boolean value)
Configuration property: Ignore unknown properties with null values.
|
RestContextBuilder |
implClass(Class<?> interfaceClass,
Class<?> implClass)
Configuration property: Implementation classes.
|
RestContextBuilder |
implClasses(Map<String,Class<?>> values)
Configuration property: Implementation classes.
|
RestContextBuilder |
infoProvider(Class<? extends RestInfoProvider> value)
Configuration property: REST info provider.
|
RestContextBuilder |
infoProvider(RestInfoProvider value)
Configuration property: REST info provider.
|
RestContextBuilder |
locale(Locale value)
Configuration property: Locale.
|
RestContextBuilder |
logger(Class<? extends RestLogger> value)
Deprecated.
|
RestContextBuilder |
logger(RestLogger value)
Deprecated.
|
RestContextBuilder |
maxInput(String value)
Configuration property: The maximum allowed input size (in bytes) on HTTP requests.
|
RestContextBuilder |
mediaType(MediaType value)
Configuration property: Media type.
|
RestContextBuilder |
messages(Class<?> baseClass,
String bundlePath)
Configuration property: Messages.
|
RestContextBuilder |
messages(MessageBundleLocation... values)
Configuration property: Messages.
|
RestContextBuilder |
messages(String bundlePath)
Configuration property: Messages.
|
RestContextBuilder |
mimeTypes(String... values)
Configuration property: MIME types.
|
RestContextBuilder |
notBeanClasses(Class<?>... values)
Configuration property: Bean class exclusions.
|
RestContextBuilder |
notBeanClasses(Object... values)
Configuration property: Bean class exclusions.
|
RestContextBuilder |
notBeanClassesRemove(Class<?>... values)
Configuration property: Bean class exclusions.
|
RestContextBuilder |
notBeanClassesRemove(Object... values)
Configuration property: Bean class exclusions.
|
RestContextBuilder |
notBeanClassesReplace(Class<?>... values)
Configuration property: Bean class exclusions.
|
RestContextBuilder |
notBeanClassesReplace(Object... values)
Configuration property: Bean class exclusions.
|
RestContextBuilder |
notBeanPackages(Object... values)
Configuration property: Bean package exclusions.
|
RestContextBuilder |
notBeanPackages(String... values)
Configuration property: Bean package exclusions.
|
RestContextBuilder |
notBeanPackagesRemove(Object... values)
Configuration property: Bean package exclusions.
|
RestContextBuilder |
notBeanPackagesRemove(String... values)
Configuration property: Bean package exclusions.
|
RestContextBuilder |
notBeanPackagesReplace(Object... values)
Configuration property: Bean package exclusions.
|
RestContextBuilder |
notBeanPackagesReplace(String... values)
Configuration property: Bean package exclusions.
|
RestContextBuilder |
paramResolvers(Class<? extends RestMethodParam>... values)
Configuration property: Java method parameter resolvers.
|
RestContextBuilder |
paramResolvers(RestMethodParam... values)
Configuration property: Java method parameter resolvers.
|
RestContextBuilder |
parserListener(Class<? extends ParserListener> value)
Configuration property: Parser listener.
|
RestContextBuilder |
parsers(Class<?>... values)
Configuration property: Parsers.
|
RestContextBuilder |
parsers(Object... values)
Configuration property: Parsers.
|
RestContextBuilder |
parsersReplace(Object... values)
Configuration property: Parsers.
|
RestContextBuilder |
partParser(Class<? extends HttpPartParser> value)
Configuration property: HTTP part parser.
|
RestContextBuilder |
partParser(HttpPartParser value)
Configuration property: HTTP part parser.
|
RestContextBuilder |
partSerializer(Class<? extends HttpPartSerializer> value)
Configuration property: HTTP part serializer.
|
RestContextBuilder |
partSerializer(HttpPartSerializer value)
Configuration property: HTTP part serializer.
|
RestContextBuilder |
path(String value)
Configuration property: Resource path.
|
RestContextBuilder |
pojoSwaps(Class<?>... values)
Configuration property: POJO swaps.
|
RestContextBuilder |
pojoSwaps(Object... values)
Configuration property: POJO swaps.
|
RestContextBuilder |
pojoSwapsRemove(Class<?>... values)
Configuration property: POJO swaps.
|
RestContextBuilder |
pojoSwapsRemove(Object... values)
Configuration property: POJO swaps.
|
RestContextBuilder |
pojoSwapsReplace(Class<?>... values)
Configuration property: POJO swaps.
|
RestContextBuilder |
pojoSwapsReplace(Object... values)
Configuration property: POJO swaps.
|
RestContextBuilder |
produces(MediaType... values)
Configuration property: Supported accept media types.
|
RestContextBuilder |
produces(String... values)
Configuration property: Supported accept media types.
|
RestContextBuilder |
producesReplace(MediaType... values)
Configuration property: Supported accept media types.
|
RestContextBuilder |
producesReplace(String... values)
Configuration property: Supported accept media types.
|
RestContextBuilder |
properties(Map<String,Object> values)
Configuration property: Properties.
|
RestContextBuilder |
property(String name,
Object value)
Configuration property: Properties.
|
RestContextBuilder |
removeFrom(String name,
Object value)
Removes a value from a SET, LIST, or MAP property.
|
RestContextBuilder |
renderResponseStackTraces()
Configuration property: Render response stack traces in responses.
|
RestContextBuilder |
renderResponseStackTraces(boolean value)
Configuration property: Render response stack traces in responses.
|
RestContextBuilder |
resourceResolver(Class<? extends RestResourceResolver> value)
REST resource resolver.
|
RestContextBuilder |
resourceResolver(RestResourceResolver value)
REST resource resolver.
|
RestContextBuilder |
responseHandlers(Class<?>... values)
Configuration property: Response handlers.
|
RestContextBuilder |
responseHandlers(ResponseHandler... values)
Configuration property: Response handlers.
|
RestContextBuilder |
roleGuard(String value)
Configuration property: Role guard.
|
RestContextBuilder |
rolesDeclared(String... values)
Configuration property: Declared roles.
|
RestContextBuilder |
serializerListener(Class<? extends SerializerListener> value)
Configuration property: Serializer listener.
|
RestContextBuilder |
serializers(Class<?>... values)
Configuration property: Serializers.
|
RestContextBuilder |
serializers(Object... values)
Configuration property: Serializers.
|
RestContextBuilder |
serializersReplace(Class<?>... values)
Configuration property: Serializers.
|
RestContextBuilder |
serializersReplace(Object... values)
Configuration property: Serializers.
|
RestContextBuilder |
set(Map<String,Object> properties)
Sets multiple configuration properties on this object.
|
RestContextBuilder |
set(String name,
Object value)
Sets a configuration property on this object.
|
RestContextBuilder |
sortProperties()
Configuration property: Sort bean properties.
|
RestContextBuilder |
sortProperties(boolean value)
Configuration property: Sort bean properties.
|
RestContextBuilder |
staticFileResponseHeader(String name,
String value)
Configuration property: Static file response headers.
|
RestContextBuilder |
staticFileResponseHeaders(Map<String,String> headers)
Configuration property: Static file response headers.
|
RestContextBuilder |
staticFileResponseHeaders(String... headers)
Configuration property: Static file response headers.
|
RestContextBuilder |
staticFileResponseHeadersReplace(Map<String,String> headers)
Configuration property: Static file response headers.
|
RestContextBuilder |
staticFiles(Class<?> baseClass,
String mappingString)
Configuration property: Static file mappings.
|
RestContextBuilder |
staticFiles(Class<?> baseClass,
String path,
String location)
Configuration property: Static file mappings.
|
RestContextBuilder |
staticFiles(StaticFileMapping... values)
Configuration property: Static file mappings.
|
RestContextBuilder |
staticFiles(String mappingString)
Configuration property: Static file mappings.
|
RestContextBuilder |
staticFiles(String path,
String location)
Configuration property: Static file mappings.
|
RestContextBuilder |
timeZone(TimeZone value)
Configuration property: TimeZone.
|
RestContextBuilder |
uriAuthority(String value)
Configuration property: Resource authority path.
|
RestContextBuilder |
uriContext(String value)
Configuration property: Resource context path.
|
RestContextBuilder |
uriRelativity(String value)
Configuration property: URI resolution relativity.
|
RestContextBuilder |
uriResolution(String value)
Configuration property: URI resolution.
|
RestContextBuilder |
useClasspathResourceCaching(boolean value)
Configuration property: Use classpath resource caching.
|
RestContextBuilder |
useEnumNames()
Configuration property: Use enum names.
|
RestContextBuilder |
useEnumNames(boolean value)
Configuration property: Use enum names.
|
RestContextBuilder |
useInterfaceProxies(boolean value)
Configuration property: Use interface proxies.
|
RestContextBuilder |
useJavaBeanIntrospector()
Configuration property: Use Java Introspector.
|
RestContextBuilder |
useJavaBeanIntrospector(boolean value)
Configuration property: Use Java Introspector.
|
RestContextBuilder |
useStackTraceHashes(boolean value)
Deprecated.
|
RestContextBuilder |
varContextObject(String name,
Object object)
Adds a var context object to this config.
|
RestContextBuilder |
vars(Class<?>... vars)
Adds the specified
Var classes to this config. |
RestContextBuilder |
widgets(Class<? extends Widget>... values)
Deprecated.
|
RestContextBuilder |
widgets(Widget... values)
Deprecated.
|
RestContextBuilder |
widgetsReplace(Class<? extends Widget>... values)
Deprecated.
|
RestContextBuilder |
widgetsReplace(Widget... values)
Deprecated.
|
examples, excludeProperties, excludeProperties, excludeProperties, fluentSetters, fluentSetters, includeProperties, includeProperties, includeProperties, propertyNamer
build, getPropertyStore, getPropertyStoreBuilder, peek, peek
public RestContext build()
ContextBuilder
build
in class BeanContextBuilder
public RestContextBuilder vars(Class<?>... vars)
Var
classes to this config.
These variables affect the variable resolver returned by RestRequest.getVarResolverSession()
which is
used to resolve string variables of the form
See RestContext.getVarResolver()
for a list of predefined variables.
vars
- The Var
classes to add to this config.public RestContextBuilder varContextObject(String name, Object object)
Var context objects are read-only objects associated with the variable resolver for vars that require external information.
For example, the ConfigVar
needs access to this resource's Config
through the
ConfigVar.SESSION_config
object that can be specified as either a session object (temporary) or
context object (permanent).
In this case, we call the following code to add it to the context map:
config.addVarContextObject(
name
- The context object key (i.e. the name that the Var class looks for).object
- The context object.public RestContextBuilder config(Config config)
By default, the config file is determined using the @RestResource(config)
annotation.
This method allows you to programmatically override it with your own custom config file.
config
- The new config file.protected PropertyStoreBuilder createPropertyStore()
PropertyStore
object initialized with the properties defined in this config.public Config getConfig()
The configuration file location is determined via the @RestResource(config)
annotation on the resource.
The config file can be programmatically overridden by adding the following method to your resource:
If a config file is not set up, then an empty config file will be returned that is not backed by any file.
public RestContextProperties getProperties()
The configuration properties are determined via the @RestResource(properties)
annotation on the resource.
The configuration properties can be augmented programmatically by adding the following method to your resource:
These properties can be modified during servlet initialization.
However, any modifications made after RestServlet.init(ServletConfig)
has been called will have no effect.
public VarResolverBuilder getVarResolverBuilder()
The variable resolver returned by this method can resolve the following variables:
Note that the variables supported here are only a subset of those returned by
RestRequest.getVarResolverSession()
.
public String getPath()
public RestContextBuilder allowBodyParam(boolean value)
When enabled, the HTTP body content on PUT and POST requests can be passed in as text using the
For example:
?body=(name='John%20Smith',age=45)
value
- The new value for this setting.
public RestContextBuilder allowedHeaderParams(String value)
When specified, allows headers such as
For example:
?Accept=text/json&Content-Type=text/json
value
- The new value for this setting.
public RestContextBuilder allowedMethodHeaders(String value)
A comma-delimited list of HTTP method names that are allowed to be passed as values in an
Allows you to override the actual HTTP method with a simulated method.
For example, if an HTTP Client API doesn't support
value
- The new value for this setting.
public RestContextBuilder allowedMethodParams(String value)
When specified, the HTTP method can be overridden by passing in a
For example:
?method=OPTIONS
value
- The new value for this setting.
["HEAD" ,"OPTIONS" ]
.
@Deprecated public RestContextBuilder allowHeaderParams(boolean value)
allowedHeaderParams(String)
When enabled, headers such as
For example:
?Accept=text/json&Content-Type=text/json
value
- The new value for this setting.
public RestContextBuilder callHandler(Class<? extends RestCallHandler> value)
This class handles the basic lifecycle of an HTTP REST call.
Subclasses can be used to customize how these HTTP calls are handled.
value
- The new value for this setting.
BasicRestCallHandler
.public RestContextBuilder callHandler(RestCallHandler value)
Same as callHandler(Class)
except input is a pre-constructed instance.
value
- The new value for this setting.
BasicRestCallHandler
.public RestContextBuilder callLogger(Class<? extends RestCallLogger> value)
Specifies the logger to use for logging of HTTP requests and responses.
value
- The new value for this setting.
BasicRestCallLogger
.public RestContextBuilder callLogger(RestCallLogger value)
Specifies the logger to use for logging of HTTP requests and responses.
value
- The new value for this setting.
BasicRestCallLogger
.public RestContextBuilder callLoggerConfig(RestCallLoggerConfig value)
Specifies rules on how to handle logging of HTTP requests/responses.
value
- The new value for this setting.
RestCallLoggerConfig.DEFAULT
.public RestContextBuilder children(Class<?>... values)
Defines children of this resource.
A REST child resource is simply another servlet that is initialized as part of the parent resource and has a servlet path directly under the parent servlet path.
values
- The values to add to this setting.public RestContextBuilder children(Object... values)
Same as children(Class...)
except input is pre-constructed instances.
values
- The values to add to this setting.public RestContextBuilder child(String path, Object child)
Shortcut for adding a single child to this resource.
This can be used for resources that don't have a @RestResource(path)
annotation.
path
- The child path relative to the parent resource URI.child
- The child to add to this resource.public RestContextBuilder classpathResourceFinder(Class<? extends ClasspathResourceFinder> value)
Used to retrieve localized files from the classpath.
value
- The new value for this setting.
ClasspathResourceFinderBasic
.public RestContextBuilder classpathResourceFinder(ClasspathResourceFinder value)
Same as classpathResourceFinder(ClasspathResourceFinder)
except input is a pre-constructed instance.
value
- The new value for this setting.
ClasspathResourceFinderBasic
.public RestContextBuilder clientVersionHeader(String value)
Specifies the name of the header used to denote the client version on HTTP requests.
The client version is used to support backwards compatibility for breaking REST interface changes.
Used in conjunction with @RestMethod(clientVersion)
annotation.
value
- The new value for this setting.
public RestContextBuilder converters(Class<?>... values)
Associates one or more converters
with a resource class.
values
- The values to add to this setting.public RestContextBuilder converters(RestConverter... values)
Same as converters(Class...)
except input is pre-constructed instances.
values
- The values to add to this setting.public RestContextBuilder debug(boolean value)
debug
in class BeanContextBuilder
value
- The new value for this setting.public RestContextBuilder debug(Enablement value)
Enables the following:
value
- The new value for this setting.public RestContextBuilder defaultCharset(String value)
The default character encoding for the request and response if not specified on the request.
value
- The new value for this setting.
public RestContextBuilder defaultCharset(Charset value)
Same as defaultCharset(Charset)
but takes in an instance of Charset
.
value
- The new value for this setting.
public RestContextBuilder attrs(String... values) throws RestServletException
Specifies default values for request attributes if they're not already set on the request.
values
- The attributes in the format RestServletException
- If malformed header is found.public RestContextBuilder defaultRequestHeaders(String... headers) throws RestServletException
Specifies default values for request headers if they're not passed in through the request.
headers
- The headers in the format RestServletException
- If malformed header is found.public RestContextBuilder defaultAccept(String value)
value
- The default value of the public RestContextBuilder defaultContentType(String value)
value
- The default value of the public RestContextBuilder attr(String name, Object value)
Same as attrs(String...)
but adds a single attribute name/value pair.
name
- The HTTP header name.value
- The HTTP header value.public RestContextBuilder defaultRequestHeader(String name, Object value)
Same as defaultRequestHeaders(String...)
but adds a single header name/value pair.
name
- The HTTP header name.value
- The HTTP header value.public RestContextBuilder defaultResponseHeaders(String... headers) throws RestServletException
Specifies default values for response headers if they're not set after the Java REST method is called.
headers
- The headers in the format RestServletException
- If malformed header is found.public RestContextBuilder defaultResponseHeader(String name, Object value)
Same as defaultResponseHeaders(String...)
but adds a single header name/value pair.
name
- The HTTP header name.value
- The HTTP header value.public RestContextBuilder encoders(Class<?>... values)
These can be used to enable various kinds of compression (e.g.
values
- The values to add to this setting.public RestContextBuilder encoders(Encoder... values)
Same as encoders(Class...)
except input a pre-constructed instances.
values
- The values to add to this setting.public RestContextBuilder guards(Class<?>... values)
Associates one or more RestGuards
with all REST methods defined in this class.
values
- The values to add to this setting.public RestContextBuilder guards(RestGuard... values)
Same as guards(Class...)
except input is pre-constructed instances.
values
- The values to add to this setting.public RestContextBuilder infoProvider(Class<? extends RestInfoProvider> value)
Class used to retrieve title/description/swagger information about a resource.
value
- The new value for this setting.
BasicRestInfoProvider
.public RestContextBuilder infoProvider(RestInfoProvider value)
Same as infoProvider(Class)
except input is a pre-constructed instance.
value
- The new value for this setting.
BasicRestInfoProvider
.@Deprecated public RestContextBuilder logger(Class<? extends RestLogger> value)
callLogger(Class)
Specifies the logger to use for logging.
value
- The new value for this setting.
BasicRestCallLogger
.
@Deprecated public RestContextBuilder logger(RestLogger value)
callLogger(RestCallLogger)
Same as logger(Class)
except input is a pre-constructed instance.
value
- The new value for this setting.
BasicRestLogger
.
public RestContextBuilder maxInput(String value)
Useful for alleviating DoS attacks by throwing an exception when too much input is received instead of resulting in out-of-memory errors which could affect system stability.
value
- The new value for this setting.
public RestContextBuilder messages(MessageBundleLocation... values)
Identifies the location of the resource bundle for this class.
values
- The values to add to this setting.public RestContextBuilder messages(Class<?> baseClass, String bundlePath)
Same as messages(MessageBundleLocation...)
except allows you to pass in the base class and bundle
path separately.
baseClass
- The base class that the bundle path is relative to.
bundlePath
- The bundle path relative to the base class.public RestContextBuilder messages(String bundlePath)
Same as messages(Class,String)
except assumes the base class is the resource class itself.
bundlePath
- The bundle path relative to the base class.public RestContextBuilder mimeTypes(String... values)
Defines MIME-type file type mappings.
values
- The values to add to this setting.public RestContextBuilder paramResolvers(Class<? extends RestMethodParam>... values)
By default, the Juneau framework will automatically Java method parameters of various types (e.g.
values
- The values to add to this setting.public RestContextBuilder paramResolvers(RestMethodParam... values)
Same as paramResolvers(Class...)
except input is pre-constructed instances.
values
- The values to add to this setting.public RestContextBuilder parserListener(Class<? extends ParserListener> value)
Specifies the parser listener class to use for listening to non-fatal parsing errors.
value
- The new value for this setting.public RestContextBuilder parsers(Class<?>... values)
Adds class-level parsers to this resource.
values
- The values to add to this setting.public RestContextBuilder parsers(Object... values)
Same as parsers(Class...)
except input is pre-constructed instances.
Parser instances are considered set-in-stone and do NOT inherit properties and transforms defined on the resource class or method.
values
- The values to add to this setting.public RestContextBuilder parsersReplace(Object... values)
Same as parsers(Class...)
except allows you to overwrite the previous value.
values
- The values to add to this setting.public RestContextBuilder partParser(Class<? extends HttpPartParser> value)
Specifies the HttpPartParser
to use for parsing headers, query/form parameters, and URI parts.
value
- The new value for this setting.
OpenApiParser
.public RestContextBuilder partParser(HttpPartParser value)
Same as partParser(Class)
except input is a pre-constructed instance.
value
- The new value for this setting.
OpenApiParser
.public RestContextBuilder partSerializer(Class<? extends HttpPartSerializer> value)
Specifies the HttpPartSerializer
to use for serializing headers, query/form parameters, and URI parts.
value
- The new value for this setting.
OpenApiSerializer
.public RestContextBuilder partSerializer(HttpPartSerializer value)
Same as partSerializer(Class)
except input is a pre-constructed instance.
value
- The new value for this setting.
OpenApiSerializer
.public RestContextBuilder path(String value)
Identifies the URL subpath relative to the parent resource.
value
- The new value for this setting.public RestContextBuilder renderResponseStackTraces(boolean value)
Render stack traces in HTTP response bodies when errors occur.
value
- The new value for this setting.
public RestContextBuilder renderResponseStackTraces()
Shortcut for calling renderResponseStackTraces(
.
public RestContextBuilder resourceResolver(Class<? extends RestResourceResolver> value)
The resolver used for resolving child resources.
Can be used to provide customized resolution of REST resource class instances (e.g. resources retrieve from Spring).
value
- The new value for this setting.
BasicRestResourceResolver
.public RestContextBuilder resourceResolver(RestResourceResolver value)
Same as resourceResolver(Class)
except input is a pre-constructed instance.
value
- The new value for this setting.
BasicRestResourceResolver
.public RestContextBuilder responseHandlers(Class<?>... values)
Specifies a list of ResponseHandler
classes that know how to convert POJOs returned by REST methods or
set via RestResponse.setOutput(Object)
into appropriate HTTP responses.
values
- The values to add to this setting.public RestContextBuilder responseHandlers(ResponseHandler... values)
Same as responseHandlers(Class...)
except input is pre-constructed instances.
values
- The values to add to this setting.public RestContextBuilder rolesDeclared(String... values)
A comma-delimited list of all possible user roles.
Used in conjunction with roleGuard(String)
is used with patterns.
values
- The values to add to this setting.public RestContextBuilder roleGuard(String value)
An expression defining if a user with the specified roles are allowed to access methods on this class.
RestResource.rolesDeclared()
or RestContext.REST_rolesDeclared
.
value
- The values to add to this setting.public RestContextBuilder serializerListener(Class<? extends SerializerListener> value)
Specifies the serializer listener class to use for listening to non-fatal serialization errors.
value
- The new value for this setting.public RestContextBuilder serializers(Class<?>... values)
Adds class-level serializers to this resource.
values
- The values to add to this setting.public RestContextBuilder serializersReplace(Class<?>... values)
Same as serializers(Class[])
but replaces any existing values.
values
- The values to set on this setting.public RestContextBuilder serializers(Object... values)
Same as serializers(Class...)
except input is pre-constructed instances.
Serializer instances are considered set-in-stone and do NOT inherit properties and transforms defined on the resource class or method.
values
- The values to add to this setting.public RestContextBuilder serializersReplace(Object... values)
Same as serializers(Class...)
except allows you to overwrite the previous value.
values
- The values to add to this setting.public RestContextBuilder staticFileResponseHeaders(Map<String,String> headers)
Used to customize the headers on responses returned for statically-served files.
headers
- The headers to add to this list.
{'Cache-Control' : 'max-age=86400, public }
.public RestContextBuilder staticFileResponseHeadersReplace(Map<String,String> headers)
Same as staticFileResponseHeaders(Map)
but replaces any previous values.
headers
- The headers to set on this list.
{'Cache-Control' : 'max-age=86400, public }
.public RestContextBuilder staticFileResponseHeaders(String... headers) throws RestServletException
Same as staticFileResponseHeaders(Map)
with append=
headers
- The headers in the format RestServletException
- If malformed header is found.public RestContextBuilder staticFileResponseHeader(String name, String value)
Same as staticFileResponseHeaders(String...)
except header is broken into name/value pair.
name
- The HTTP header name.value
- The HTTP header value.public RestContextBuilder staticFiles(StaticFileMapping... values)
Used to define paths and locations of statically-served files such as images or HTML documents.
values
- The values to append to this setting.public RestContextBuilder staticFiles(String mappingString) throws ParseException
Same as staticFiles(StaticFileMapping...)
except input is in the form of a mapping string.
Mapping string must be one of these formats:
mappingString
- The static file mapping string.ParseException
- If mapping string is malformed.public RestContextBuilder staticFiles(Class<?> baseClass, String mappingString) throws ParseException
Same as staticFiles(String)
except overrides the base class for retrieving the resource.
Mapping string must be one of these formats:
baseClass
- Overrides the default class to use for retrieving the classpath resource.
mappingString
- The static file mapping string.ParseException
- If mapping string is malformed.public RestContextBuilder staticFiles(String path, String location)
Same as staticFiles(String)
except path and location are already split values.
path
- The mapped URI path.
location
- The location relative to the resource class.
public RestContextBuilder staticFiles(Class<?> baseClass, String path, String location)
Same as staticFiles(String,String)
except overrides the base class for retrieving the resource.
baseClass
- Overrides the default class to use for retrieving the classpath resource.
path
- The mapped URI path.
location
- The location relative to the resource class.
public RestContextBuilder produces(String... values)
Overrides the media types inferred from the serializers that identify what media types can be produced by the resource.
values
- The values to add to this setting.public RestContextBuilder producesReplace(String... values)
Same as produces(String...)
but replaces any previous values.
values
- The values to set on this setting.public RestContextBuilder produces(MediaType... values)
Same as produces(String...)
except input is MediaType
instances.
values
- The values to add to this setting.public RestContextBuilder producesReplace(MediaType... values)
Same as produces(MediaType...)
but replaces any previous values.
values
- The values to set on this setting.public RestContextBuilder consumes(String... values)
Overrides the media types inferred from the parsers that identify what media types can be consumed by the resource.
values
- The values to add to this setting.public RestContextBuilder consumesReplace(String... values)
Same as consumes(String...)
but replaces any existing values.
values
- The values to set on this setting.public RestContextBuilder consumes(MediaType... values)
Same as consumes(String...)
except input is MediaType
instances.
values
- The values to add to this setting.public RestContextBuilder consumesReplace(MediaType... values)
Same as consumes(MediaType...)
except replaces any existing values.
values
- The values to set on this setting.public RestContextBuilder properties(Map<String,Object> values)
Shortcut to add properties to the bean contexts of all serializers and parsers on all methods in the class.
Any of the properties defined on RestContext
or any of the serializers and parsers can be specified.
Property values will be converted to the appropriate type.
values
- The values to set on this setting.public RestContextBuilder property(String name, Object value)
Shortcut to add properties to the bean contexts of all serializers and parsers on all methods in the class.
Any of the properties defined on RestContext
or any of the serializers and parsers can be specified.
Property values will be converted to the appropriate type.
name
- The key to add to the properties.value
- The value to add to the properties.public RestContextBuilder uriAuthority(String value)
Overrides the authority path value for this resource and any child resources.
This setting is useful if you want to resolve relative URIs to absolute paths and want to explicitly specify the hostname/port.
value
- The new value for this setting.public RestContextBuilder uriContext(String value)
Overrides the context path value for this resource and any child resources.
This setting is useful if you want to use
value
- The new value for this setting.public RestContextBuilder uriRelativity(String value)
Specifies how relative URIs should be interpreted by serializers.
See UriResolution
for possible values.
value
- The new value for this setting.public RestContextBuilder uriResolution(String value)
Specifies how relative URIs should be interpreted by serializers.
See UriResolution
for possible values.
value
- The new value for this setting.public RestContextBuilder useClasspathResourceCaching(boolean value)
When enabled, resources retrieved via RestContext.getClasspathResource(String, Locale)
(and related
methods) will be cached in memory to speed subsequent lookups.
value
- The new value for this setting.
@Deprecated public RestContextBuilder useStackTraceHashes(boolean value)
callLoggerConfig(RestCallLoggerConfig)
When enabled, the number of times an exception has occurred will be determined based on stack trace hashsums,
made available through the RestException.getOccurrence()
method.
value
- The new value for this setting.
@Deprecated public RestContextBuilder widgets(Class<? extends Widget>... values)
HtmlDocSerializerBuilder.widgets(Class[])
Defines widgets that can be used in conjunction with string variables of the form
values
- The values to add to this setting.@Deprecated public RestContextBuilder widgetsReplace(Class<? extends Widget>... values)
HtmlDocSerializerBuilder.widgetsReplace(Class[])
Same as widgets(Class...)
but replaces any previous values.
values
- The values to set on this setting.@Deprecated public RestContextBuilder widgets(Widget... values)
HtmlDocSerializerBuilder.widgets(HtmlWidget[])
Same as widgets(Class...)
except input is pre-constructed instances.
values
- The values to add to this setting.@Deprecated public RestContextBuilder widgetsReplace(Widget... values)
HtmlDocSerializerBuilder.widgetsReplace(HtmlWidget[])
Same as widgets(Widget...)
except allows you to overwrite the previous value.
values
- The values to add to this setting.public RestContextBuilder beanClassVisibility(Visibility value)
BeanContextBuilder
Classes are not considered beans unless they meet the minimum visibility requirements.
For example, if the visibility is
beanClassVisibility
in class BeanContextBuilder
value
- The new value for this property.
Visibility.PUBLIC
.public RestContextBuilder beanConstructorVisibility(Visibility value)
BeanContextBuilder
Only look for constructors with the specified minimum visibility.
beanConstructorVisibility
in class BeanContextBuilder
value
- The new value for this property.
Visibility.PUBLIC
.public RestContextBuilder beanDictionary(Class<?>... values)
BeanContextBuilder
Same as BeanContextBuilder.beanDictionary(Object...)
but takes in an array of classes.
beanDictionary
in class BeanContextBuilder
values
- The values to add to this property.public RestContextBuilder beanDictionary(Object... values)
BeanContextBuilder
Adds to the list of classes that make up the bean dictionary in this bean context.
beanDictionary
in class BeanContextBuilder
values
- The values to add to this property.public RestContextBuilder beanDictionaryReplace(Class<?>... values)
BeanContextBuilder
Same as BeanContextBuilder.beanDictionary(Object...)
but replaces the existing value.
beanDictionaryReplace
in class BeanContextBuilder
values
- The new values for this property.public RestContextBuilder beanDictionaryReplace(Object... values)
BeanContextBuilder
Same as BeanContextBuilder.beanDictionary(Object...)
but replaces the existing value.
beanDictionaryReplace
in class BeanContextBuilder
values
- The new values for this property.public RestContextBuilder beanDictionaryRemove(Class<?>... values)
BeanContextBuilder
Removes from the list of classes that make up the bean dictionary in this bean context.
beanDictionaryRemove
in class BeanContextBuilder
values
- The values to remove from this property.public RestContextBuilder beanDictionaryRemove(Object... values)
BeanContextBuilder
Removes from the list of classes that make up the bean dictionary in this bean context.
beanDictionaryRemove
in class BeanContextBuilder
values
- The values to remove from this property.public RestContextBuilder beanFieldVisibility(Visibility value)
BeanContextBuilder
Only look for bean fields with the specified minimum visibility.
beanFieldVisibility
in class BeanContextBuilder
value
- The new value for this property.
Visibility.PUBLIC
.public RestContextBuilder beanFilters(Class<?>... values)
BeanContextBuilder
Same as BeanContextBuilder.beanFilters(Object...)
but takes in an array of classes.
beanFilters
in class BeanContextBuilder
values
- The values to add to this property.public RestContextBuilder beanFilters(Object... values)
BeanContextBuilder
This is a programmatic equivalent to the @Bean
annotation.
It's useful when you want to use the Bean annotation functionality, but you don't have the ability to alter
the bean classes.
beanFilters
in class BeanContextBuilder
values
- The values to add to this property.
@Bean(typeName)
.
BeanDictionaryList
containing a collection of bean classes with type name annotations.
BeanDictionaryMap
containing a mapping of type names to classes without type name annotations.
public RestContextBuilder beanFiltersReplace(Class<?>... values)
BeanContextBuilder
Same as BeanContextBuilder.beanFilters(Object...)
but replaces the existing values.
beanFiltersReplace
in class BeanContextBuilder
values
- The new values for this property.
@Bean(typeName)
.
BeanDictionaryList
containing a collection of bean classes with type name annotations.
BeanDictionaryMap
containing a mapping of type names to classes without type name annotations.
public RestContextBuilder beanFiltersReplace(Object... values)
BeanContextBuilder
Same as BeanContextBuilder.beanFilters(Object...)
but replaces the existing values.
beanFiltersReplace
in class BeanContextBuilder
values
- The new values for this property.
@Bean(typeName)
.
BeanDictionaryList
containing a collection of bean classes with type name annotations.
BeanDictionaryMap
containing a mapping of type names to classes without type name annotations.
public RestContextBuilder beanFiltersRemove(Class<?>... values)
BeanContextBuilder
Removes from the list of classes that make up the bean filters in this bean context.
beanFiltersRemove
in class BeanContextBuilder
values
- The values to remove from this property.
@Bean(typeName)
.
BeanDictionaryList
containing a collection of bean classes with type name annotations.
BeanDictionaryMap
containing a mapping of type names to classes without type name annotations.
public RestContextBuilder beanFiltersRemove(Object... values)
BeanContextBuilder
Removes from the list of classes that make up the bean filters in this bean context.
beanFiltersRemove
in class BeanContextBuilder
values
- The values to remove from this property.
@Bean(typeName)
.
BeanDictionaryList
containing a collection of bean classes with type name annotations.
BeanDictionaryMap
containing a mapping of type names to classes without type name annotations.
public RestContextBuilder beanMapPutReturnsOldValue(boolean value)
BeanContextBuilder
If BeanMap.put()
method will return old property
values.
Otherwise, it returns
beanMapPutReturnsOldValue
in class BeanContextBuilder
value
- The new value for this property.
public RestContextBuilder beanMapPutReturnsOldValue()
BeanContextBuilder
Shortcut for calling beanMapPutReturnsOldValue(
.
beanMapPutReturnsOldValue
in class BeanContextBuilder
public RestContextBuilder beanMethodVisibility(Visibility value)
BeanContextBuilder
Only look for bean methods with the specified minimum visibility.
beanMethodVisibility
in class BeanContextBuilder
value
- The new value for this property.
Visibility.PUBLIC
public RestContextBuilder beansRequireDefaultConstructor(boolean value)
BeanContextBuilder
If
Otherwise, the bean will be serialized as a string using the Object.toString()
method.
beansRequireDefaultConstructor
in class BeanContextBuilder
value
- The new value for this property.
public RestContextBuilder beansRequireDefaultConstructor()
BeanContextBuilder
Shortcut for calling beansRequireDefaultConstructor(
.
beansRequireDefaultConstructor
in class BeanContextBuilder
public RestContextBuilder beansRequireSerializable(boolean value)
BeanContextBuilder
If Serializable
interface to be considered a bean.
Otherwise, the bean will be serialized as a string using the Object.toString()
method.
beansRequireSerializable
in class BeanContextBuilder
value
- The new value for this property.
public RestContextBuilder beansRequireSerializable()
BeanContextBuilder
Shortcut for calling beansRequireSerializable(
.
beansRequireSerializable
in class BeanContextBuilder
public RestContextBuilder beansRequireSettersForGetters(boolean value)
BeanContextBuilder
If
Otherwise, they will be ignored.
beansRequireSettersForGetters
in class BeanContextBuilder
value
- The new value for this property.
public RestContextBuilder beansRequireSettersForGetters()
BeanContextBuilder
Shortcut for calling beansRequireSettersForGetters(
.
beansRequireSettersForGetters
in class BeanContextBuilder
public RestContextBuilder beansRequireSomeProperties(boolean value)
BeanContextBuilder
If
Otherwise, the bean will be serialized as a string using the Object.toString()
method.
beansRequireSomeProperties
in class BeanContextBuilder
value
- The new value for this property.
public RestContextBuilder beanTypePropertyName(String value)
BeanContextBuilder
This specifies the name of the bean property used to store the dictionary name of a bean type so that the parser knows the data type to reconstruct.
beanTypePropertyName
in class BeanContextBuilder
value
- The new value for this property.
public RestContextBuilder debug()
BeanContextBuilder
Shortcut for calling debug(
.
debug
in class BeanContextBuilder
public <T> RestContextBuilder example(Class<T> c, T o)
BeanContextBuilder
Specifies an example of the specified class.
example
in class BeanContextBuilder
c
- The POJO class.o
- An instance of the POJO class used for examples.public <T> RestContextBuilder exampleJson(Class<T> c, String value)
BeanContextBuilder
Specifies an example of the specified class.
exampleJson
in class BeanContextBuilder
T
- The POJO class type.c
- The POJO class.value
- The simple JSON representation of the example.public RestContextBuilder ignoreInvocationExceptionsOnGetters(boolean value)
BeanContextBuilder
If BeanRuntimeException
is thrown.
ignoreInvocationExceptionsOnGetters
in class BeanContextBuilder
value
- The new value for this property.
public RestContextBuilder ignoreInvocationExceptionsOnGetters()
BeanContextBuilder
Shortcut for calling ignoreInvocationExceptionsOnGetters(
.
ignoreInvocationExceptionsOnGetters
in class BeanContextBuilder
public RestContextBuilder ignoreInvocationExceptionsOnSetters(boolean value)
BeanContextBuilder
If
Otherwise, a BeanRuntimeException
is thrown.
ignoreInvocationExceptionsOnSetters
in class BeanContextBuilder
value
- The new value for this property.
public RestContextBuilder ignoreInvocationExceptionsOnSetters()
BeanContextBuilder
Shortcut for calling ignoreInvocationExceptionsOnSetters(
.
ignoreInvocationExceptionsOnSetters
in class BeanContextBuilder
public RestContextBuilder ignorePropertiesWithoutSetters(boolean value)
BeanContextBuilder
If
Otherwise, a BeanRuntimeException
is thrown.
ignorePropertiesWithoutSetters
in class BeanContextBuilder
value
- The new value for this property.
public RestContextBuilder ignoreUnknownBeanProperties(boolean value)
BeanContextBuilder
If
Otherwise, a BeanRuntimeException
is thrown.
ignoreUnknownBeanProperties
in class BeanContextBuilder
value
- The new value for this property.
public RestContextBuilder ignoreUnknownBeanProperties()
BeanContextBuilder
Shortcut for calling ignoreUnknownBeanProperties(
.
ignoreUnknownBeanProperties
in class BeanContextBuilder
public RestContextBuilder ignoreUnknownNullBeanProperties(boolean value)
BeanContextBuilder
If
Otherwise, a BeanRuntimeException
is thrown.
ignoreUnknownNullBeanProperties
in class BeanContextBuilder
value
- The new value for this property.
public RestContextBuilder implClass(Class<?> interfaceClass, Class<?> implClass)
BeanContextBuilder
implClass
in class BeanContextBuilder
interfaceClass
- The interface class.implClass
- The implementation class.public RestContextBuilder implClasses(Map<String,Class<?>> values)
BeanContextBuilder
For interfaces and abstract classes this method can be used to specify an implementation class for the interface/abstract class so that instances of the implementation class are used when instantiated (e.g. during a parse).
implClasses
in class BeanContextBuilder
values
- The new value for this property.public RestContextBuilder locale(Locale value)
BeanContextBuilder
Specifies a default locale for serializer and parser sessions.
locale
in class BeanContextBuilder
value
- The new value for this property.public RestContextBuilder mediaType(MediaType value)
BeanContextBuilder
Specifies a default media type value for serializer and parser sessions.
mediaType
in class BeanContextBuilder
value
- The new value for this property.public RestContextBuilder notBeanClasses(Class<?>... values)
BeanContextBuilder
List of classes that should not be treated as beans even if they appear to be bean-like.
Not-bean classes are converted to
notBeanClasses
in class BeanContextBuilder
values
- The values to add to this property.public RestContextBuilder notBeanClasses(Object... values)
BeanContextBuilder
List of classes that should not be treated as beans even if they appear to be bean-like.
Not-bean classes are converted to
notBeanClasses
in class BeanContextBuilder
values
- The values to add to this property.
public RestContextBuilder notBeanClassesReplace(Class<?>... values)
BeanContextBuilder
Not-bean classes are converted to
notBeanClassesReplace
in class BeanContextBuilder
values
- The new value for this property.public RestContextBuilder notBeanClassesReplace(Object... values)
BeanContextBuilder
Not-bean classes are converted to
notBeanClassesReplace
in class BeanContextBuilder
values
- The new value for this property.
public RestContextBuilder notBeanClassesRemove(Class<?>... values)
BeanContextBuilder
notBeanClassesRemove
in class BeanContextBuilder
values
- The values to remove from this property.public RestContextBuilder notBeanClassesRemove(Object... values)
BeanContextBuilder
notBeanClassesRemove
in class BeanContextBuilder
values
- The values to remove from this property.
public RestContextBuilder notBeanPackages(Object... values)
BeanContextBuilder
notBeanPackages
in class BeanContextBuilder
values
- The values to add to this property.
public RestContextBuilder notBeanPackages(String... values)
BeanContextBuilder
notBeanPackages
in class BeanContextBuilder
values
- The values to add to this property.public RestContextBuilder notBeanPackagesReplace(String... values)
BeanContextBuilder
notBeanPackagesReplace
in class BeanContextBuilder
values
- public RestContextBuilder notBeanPackagesReplace(Object... values)
BeanContextBuilder
notBeanPackagesReplace
in class BeanContextBuilder
values
- public RestContextBuilder notBeanPackagesRemove(String... values)
BeanContextBuilder
notBeanPackagesRemove
in class BeanContextBuilder
values
- The values to remove from this property.public RestContextBuilder notBeanPackagesRemove(Object... values)
BeanContextBuilder
notBeanPackagesRemove
in class BeanContextBuilder
values
- public RestContextBuilder pojoSwaps(Class<?>... values)
BeanContextBuilder
pojoSwaps
in class BeanContextBuilder
values
- The values to add to this property.public RestContextBuilder pojoSwaps(Object... values)
BeanContextBuilder
pojoSwaps
in class BeanContextBuilder
values
- The values to add to this property.
PojoSwap
.
SurrogateSwap
.
public RestContextBuilder pojoSwapsReplace(Class<?>... values)
BeanContextBuilder
pojoSwapsReplace
in class BeanContextBuilder
values
- The values to remove from this property.
PojoSwap
.
SurrogateSwap
.
public RestContextBuilder pojoSwapsReplace(Object... values)
BeanContextBuilder
pojoSwapsReplace
in class BeanContextBuilder
values
- The values to remove from this property.
PojoSwap
.
SurrogateSwap
.
public RestContextBuilder pojoSwapsRemove(Class<?>... values)
BeanContextBuilder
pojoSwapsRemove
in class BeanContextBuilder
values
- The values to remove from this property.
PojoSwap
.
SurrogateSwap
.
public RestContextBuilder pojoSwapsRemove(Object... values)
BeanContextBuilder
pojoSwapsRemove
in class BeanContextBuilder
values
- The values to remove from this property.
PojoSwap
.
SurrogateSwap
.
public RestContextBuilder sortProperties(boolean value)
BeanContextBuilder
When
sortProperties
in class BeanContextBuilder
value
- The new value for this property.
public RestContextBuilder sortProperties()
BeanContextBuilder
Shortcut for calling sortProperties(
.
sortProperties
in class BeanContextBuilder
public RestContextBuilder timeZone(TimeZone value)
BeanContextBuilder
timeZone
in class BeanContextBuilder
value
- The new value for this property.public RestContextBuilder useEnumNames(boolean value)
BeanContextBuilder
When enabled, enums are always serialized by name instead of using Object.toString()
.
useEnumNames
in class BeanContextBuilder
value
- The property value.public RestContextBuilder useEnumNames()
BeanContextBuilder
When enabled, enums are always serialized by name instead of using Object.toString()
.
useEnumNames
in class BeanContextBuilder
public RestContextBuilder useInterfaceProxies(boolean value)
BeanContextBuilder
If InvocationHandler
if there is no other way of instantiating them.
useInterfaceProxies
in class BeanContextBuilder
value
- The new value for this property.
public RestContextBuilder useJavaBeanIntrospector(boolean value)
BeanContextBuilder
Using the built-in Java bean introspector will not pick up fields or non-standard getters/setters.
@Bean
annotations will be ignored if you enable this setting.
useJavaBeanIntrospector
in class BeanContextBuilder
value
- The new value for this property.
public RestContextBuilder useJavaBeanIntrospector()
BeanContextBuilder
Shortcut for calling useJavaBeanIntrospector(
.
useJavaBeanIntrospector
in class BeanContextBuilder
public RestContextBuilder set(String name, Object value)
ContextBuilder
set
in class BeanContextBuilder
name
- The property name.value
- The property value.PropertyStoreBuilder.set(String, Object)
public RestContextBuilder set(Map<String,Object> properties)
ContextBuilder
set
in class BeanContextBuilder
properties
- The properties to set on this class.PropertyStoreBuilder.set(java.util.Map)
public RestContextBuilder add(Map<String,Object> properties)
ContextBuilder
add
in class BeanContextBuilder
properties
- The properties to set on this class.PropertyStoreBuilder.add(java.util.Map)
public RestContextBuilder addTo(String name, Object value)
ContextBuilder
addTo
in class BeanContextBuilder
name
- The property name.value
- The new value to add to the SET property.public RestContextBuilder addTo(String name, String key, Object value)
ContextBuilder
addTo
in class BeanContextBuilder
name
- The property name.key
- The property value map key.value
- The property value map value.public RestContextBuilder removeFrom(String name, Object value)
ContextBuilder
removeFrom
in class BeanContextBuilder
name
- The property name.value
- The property value in the SET property.public RestContextBuilder apply(PropertyStore copyFrom)
ContextBuilder
apply
in class BeanContextBuilder
copyFrom
- The factory whose settings are being copied.public RestContextBuilder applyAnnotations(AnnotationList al, VarResolverSession vrs)
ContextBuilder
applyAnnotations
in class BeanContextBuilder
al
- The list of all annotations annotated with PropertyStoreApply
.vrs
- The string resolver for resolving variables in annotation values.public RestContextBuilder applyAnnotations(Class<?> fromClass)
ContextBuilder
Applies any of the following annotations:
BeanConfig
CsvConfig
HtmlConfig
HtmlDocConfig
JsoConfig
JsonConfig
JsonSchemaConfig
MsgPackConfig
OpenApiConfig
ParserConfig
PlainTextConfig
SerializerConfig
SoapXmlConfig
UonConfig
UrlEncodingConfig
XmlConfig
Annotations are appended in the following order:
applyAnnotations
in class BeanContextBuilder
fromClass
- The class on which the annotations are defined.public RestContextBuilder applyAnnotations(Method fromMethod)
ContextBuilder
Applies any of the following annotations:
BeanConfig
CsvConfig
HtmlConfig
HtmlDocConfig
JsoConfig
JsonConfig
JsonSchemaConfig
MsgPackConfig
OpenApiConfig
ParserConfig
PlainTextConfig
SerializerConfig
SoapXmlConfig
UonConfig
UrlEncodingConfig
XmlConfig
Annotations are appended in the following orders:
applyAnnotations
in class BeanContextBuilder
fromMethod
- The method on which the annotations are defined.public String getInitParameter(String name)
getInitParameter
in interface ServletConfig
public Enumeration<String> getInitParameterNames()
getInitParameterNames
in interface ServletConfig
public ServletContext getServletContext()
getServletContext
in interface ServletConfig
public String getServletName()
getServletName
in interface ServletConfig
Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.