The only other option I see is to make ValueMap a first class citizen and:
a) add a getValueMap() method to Resource - default implementation in
AbstractResource does the same as ResourceUtil does today
b) clearly state that deep gets are allowed for reading from those maps
c) provide utility code in AbstractResource (or maybe somewhere else) so
implementations do not need to copy the same code over and over again

This would mean:
a) current code does not need to change, regardless whether ResourceUtil or
adaptTo is used
b) a value map is always provided
c) all value maps support deep reads
d) no code duplication necessary

Carsten


2014-03-14 11:37 GMT+01:00 Carsten Ziegeler <cziege...@apache.org>:

> The idea behind ResourceUtil.getValueMap is that it never returns null
> while resource.adaptTo(ValueMap) can.
> That's the whole point of this utility method.
>
> I assume people who do resource.adaptTo(ValueMap) never check for null
> which is bound to fail
>
> Carsten
>
>
> 2014-03-14 11:30 GMT+01:00 Amit.. Gupta. <amitg...@adobe.com>:
>
> > FWIW, there are lots of calls to resource.adaptTo(ValueMap) in rendering
>> code.
>> +1
>>
>>
>
>
> --
> Carsten Ziegeler
> cziege...@apache.org
>



-- 
Carsten Ziegeler
cziege...@apache.org

Reply via email to