public interface RestResourceResolver
Class
objects to instances.
Used to convert classes defined via @RestResource.children()
into child instances.
Subclasses can be created to provide customized resource resolution. These can be associated with REST resources in one of the following ways:
@RestResource.resourceResolver()
annotation.
RestContextBuilder.resourceResolver(Class)
/RestContextBuilder.resourceResolver(RestResourceResolver)
methods.
Modifier and Type | Interface and Description |
---|---|
static interface |
RestResourceResolver.Null
Represents no RestResourceResolver.
|
Modifier and Type | Method and Description |
---|---|
Object |
resolve(Object parent,
Class<?> c,
RestContextBuilder builder)
Resolves the specified class to a resource object.
|
Object resolve(Object parent, Class<?> c, RestContextBuilder builder) throws Exception
Subclasses can override this method to provide their own custom resolution.
The default implementation simply creates a new class instance using Class.newInstance()
.
parent
- The parent resource (i.e. the instance whose class has the @RestResource.children()
annotation.c
- The class to resolve.builder
- The initialization configuration for the resource.Exception
- If class could not be resolved.Copyright © 2018 Apache. All rights reserved.