Giri
Şu satırı dahil ederiz.
Şöyle yaparız.
Şöyle yaparız.
Açıklaması şöyle
Şöyle yaparız.
cleartProperty(...) + addProperty(...) gibi çalışır.
Örnek
Şöyle yaparız.
Şu satırı dahil ederiz.
import org.apache.commons.configuration2.PropertiesConfiguration;Şöyle yaparız.
Configuration config = null;
try {
  config = new PropertiesConfiguration("config.properties"); 
} catch (ConfigurationException e) {
  ...
}Şöyle yaparız.
config.addProperty("VALUE_FACTORY", BVF_extendo4000.INSTANCE);Açıklaması şöyle
Each PropertiesConfiguration object is associated with a Layout object, an instance of the class PropertiesConfigurationLayout. This layout object is responsible for preserving most of the structure of loaded configuration files. This means that things like comments or blank lines in a saved properties file will closely resemble the original properties file (the algorithm is not 100 percent perfect, but for most use cases it should be sufficient).Şöyle yaparız.
PropertiesConfigurationLayout layout = config.getLayout();Şöyle yaparız.
config.save( new FileWriter( "c:/try/out.props"));cleartProperty(...) + addProperty(...) gibi çalışır.
Örnek
Şöyle yaparız.
PropertiesConfiguration config =  new PropertiesConfiguration("in.properties");
config.setProperty("application.version", "myvar"); 
Hiç yorum yok:
Yorum Gönder