...
If you want a resource to be mapped to an Java object, you have to meet to three requirements:
- class must be annotated with
@SliceResource
, - object must be created using injector. All classes annotated with
@SliceResource
are bound toSliceResourceProvider
which is responsible for reading a current resource and invoking mapping to an object. Usually, you will be usingModelProvider
to specify from which resource to map, - class cannot be nested.
You don't need to invoke anything by yourself, if an object is injected and annotated with @SliceResource
it will be automatically mapped from current resource.
...