This sample show us how to use the PropertyManager
Este ejemplo nos muestra como utilizar el PropertyManager
finders=switch,environment,system finder.switch.class= ar.com.scf.impl.PropertyFinder finder.switch.params= sample03/switch.properties finder.environment.class= ar.com.scf.impl.PropertyFinder finder.environment.params= sample03/${environment}.properties finder.system.class= ar.com.scf.impl.SystemPropertyFinder finder.system.params
environment=linux
config.os.name=Linux
config.os.name=Windows
package ar.com.scf.sample03; import java.io.File; import ar.com.scf.impl.PropertyManager; public class Sample { public static void main(String[] args) { PropertyManager manager = new PropertyManager(new File("sample03/config.properties")); System.out.println(manager.getReplacer().expand("Current S.O. config: ${config.os.name}")); System.out.println(manager.getReplacer().expand("Current S.O.: ${os.name}")); } }
Current S.O. config: Linux Current S.O.: Windows XP