In Context aware configuration, how to read sling:configRef property in sling model
I am leveraging context-aware configuration. In my sling model class, I am using the below code to read the context-aware configuration. As we know, this uses the inheritance logic to find the first available sling:configRef property. I have sling:configRef property at multiple root levels. So, In my sling model, I need to know the following two things. I don’t see any exposed methods to get these values. I have an option to use heritanceValueMap to sling:configRef property, but I would like to know if anything is exposed out of configurationbuilder or any other implementing class. We are on 6.5.3
- Path from where sling:configRef property is getting picked up
- Value of sling:configRef property
ConfigurationBuilder configurationBuilder = resource.adaptTo(ConfigurationBuilder.class);
SampleConfig sampleConfig = configurationBuilder.as(SampleConfig.class);