I've seen Configurations in aem which has two parts, first one is a static final String with whose name i'll access the configuration property and another one is an instance variable, whose value i'll get from properties Dictionary object.
For eg in Sling's own code,
public class ResourceResolverFactoryActivator implements Runnable {
...
@Property(
boolValue = {true},
label = "Namespace Mangling",
description = ".."
)
private static final String PROP_MANGLE_NAMESPACES = "resource.resolver.manglenamespaces";
... // other code in between
private boolean mangleNamespacePrefixes;
protected void activate(ComponentContext componentContext){
...
this.mangleNamespacePrefixes = PropertiesUtil.toBoolean(properties.get("resource.resolver.manglenamespaces"), false);
...
}
what is the significance of final String PROP_MANGLE_NAMESPACES
and instance boolean mangleNamespacePrefixes
here. Why two different variables to represent only one @Property
?