toniedzwiedz commented on a change in pull request #4: Provide name hints for 
SDI configuration entries
URL: 
https://github.com/apache/sling-org-apache-sling-dynamic-include/pull/4#discussion_r192026204
 
 

 ##########
 File path: src/main/java/org/apache/sling/dynamicinclude/Configuration.java
 ##########
 @@ -97,6 +98,11 @@
 
   static final String PROPERTY_REWRITE_PATH = "include-filter.config.rewrite";
 
+  static final String NAME_HINT_PROPERTY_NAME = 
"webconsole.configurationFactory.nameHint";
 
 Review comment:
   Ah, now I see why they're all package-private :)
   
   Notice how the properties are defined outside the class.
   
   ```
   @Component(metatype = true, configurationFactory = true, label = "Apache 
Sling Dynamic Include - Configuration", immediate = true, policy = 
ConfigurationPolicy.REQUIRE)
   @Service(Configuration.class)
   @Properties({
   // private members of Configuration cannot be accessed here.
   })
   public class Configuration {
      // class body
   }
   ```
   If we keep the properties defined the way they are, the constants need to be 
visible outside the class (so package-private is the next most restrictive 
scope).
   
   Alternatively, I could refactor the whole thing so that the property 
definitions sit inside the `Configuration` class. Or extract the names and 
default values to a separate class. Still, that class would need to be 
package-private at best so no real gain here.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to