In above examples we injected resource and then adapted it to ValueMap in order to read its properties. Normally, you don't want to do this - you should use @SliceResource annotated classes and properties values will be injected in fields. Read more about Mapper.