/** * Searches all property keys that start with a given prefix. * * @param prefix the prefix that all selected property keys should share * @return the properties as iterator. */ public Iterator findPropertyKeys(final String prefix) { final TreeSet keys = new TreeSet(); collectPropertyKeys(prefix, this, keys); return Collections.unmodifiableSet(keys).iterator(); }
/** * Returns the configuration property with the specified key. * * @param key the property key. * @return the property value. */ public String getConfigProperty(final String key) { return getConfigProperty(key, null); }
/** * The new configuartion will be inserted into the list of report * configuration, so that this configuration has the given report * configuration instance as parent. * * @param config the new report configuration. */ public void insertConfiguration(final HierarchicalConfiguration config) { config.setParentConfig(getParentConfig()); setParentConfig(config); }
= new HierarchicalConfiguration(); = new PropertyFileConfiguration(); rootProperty.load(staticConfig, getClass()); globalConfig.insertConfiguration(rootProperty); globalConfig.insertConfiguration( getPackageManager().getPackageConfiguration()); final PropertyFileConfiguration baseProperty = (PropertyFileConfiguration) configs.get(i); globalConfig.insertConfiguration(baseProperty); final SystemPropertyConfiguration systemConfig = new SystemPropertyConfiguration(); globalConfig.insertConfiguration(systemConfig);
/** * Helper method for serialization. * * @param out the output stream where to write the object. * @throws java.io.IOException if errors occur while writing the stream. */ private void writeObject(final ObjectOutputStream out) throws IOException { out.defaultWriteObject(); if (isParentSaved() == false) { out.writeBoolean(false); } else { out.writeBoolean(true); out.writeObject(this.parentConfiguration); } }
/** * Helper method for serialization. * * @param in the input stream from where to read the serialized object. * @throws IOException when reading the stream fails. * @throws ClassNotFoundException if a class definition for a serialized * object could not be found. */ private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); final boolean readParent = in.readBoolean(); if (readParent) { this.parentConfiguration = (ModifiableConfiguration) in.readObject(); } else { this.parentConfiguration = null; } configurationLoaded(); }
/** * Returns the configuration property with the specified key (or the * specified default value if there is no such property). * <p/> * If the property is not defined in this configuration, the code will * lookup the property in the parent configuration. * * @param key the property key. * @param defaultValue the default value. * @return the property value. */ public String getConfigProperty(final String key, final String defaultValue) { String value = this.configuration.getProperty(key); if (value == null) { if (isRootConfig()) { value = defaultValue; } else { value = this.parentConfiguration.getConfigProperty(key, defaultValue); } } return value; }
= new HierarchicalConfiguration(); = new PropertyFileConfiguration(); rootProperty.load(staticConfig, getClass()); globalConfig.insertConfiguration(rootProperty); globalConfig.insertConfiguration( getPackageManager().getPackageConfiguration()); final PropertyFileConfiguration baseProperty = (PropertyFileConfiguration) configs.get(i); globalConfig.insertConfiguration(baseProperty); final SystemPropertyConfiguration systemConfig = new SystemPropertyConfiguration(); globalConfig.insertConfiguration(systemConfig);
/** * Helper method for serialization. * * @param out the output stream where to write the object. * @throws java.io.IOException if errors occur while writing the stream. */ private void writeObject(final ObjectOutputStream out) throws IOException { out.defaultWriteObject(); if (isParentSaved() == false) { out.writeBoolean(false); } else { out.writeBoolean(true); out.writeObject(this.parentConfiguration); } }
/** * Helper method for serialization. * * @param in the input stream from where to read the serialized object. * @throws IOException when reading the stream fails. * @throws ClassNotFoundException if a class definition for a serialized * object could not be found. */ private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); final boolean readParent = in.readBoolean(); if (readParent) { this.parentConfiguration = (ModifiableConfiguration) in.readObject(); } else { this.parentConfiguration = null; } configurationLoaded(); }
/** * Returns the configuration property with the specified key (or the * specified default value if there is no such property). * <p/> * If the property is not defined in this configuration, the code will * lookup the property in the parent configuration. * * @param key the property key. * @param defaultValue the default value. * @return the property value. */ public String getConfigProperty(final String key, final String defaultValue) { String value = this.configuration.getProperty(key); if (value == null) { if (isRootConfig()) { value = defaultValue; } else { value = this.parentConfiguration.getConfigProperty(key, defaultValue); } } return value; }
/** * The new configuartion will be inserted into the list of report * configuration, so that this configuration has the given report * configuration instance as parent. * * @param config the new report configuration. */ public void insertConfiguration(final HierarchicalConfiguration config) { config.setParentConfig(getParentConfig()); setParentConfig(config); }
= new HierarchicalConfiguration(); = new PropertyFileConfiguration(); rootProperty.load(staticConfig, getClass()); globalConfig.insertConfiguration(rootProperty); globalConfig.insertConfiguration( getPackageManager().getPackageConfiguration()); final PropertyFileConfiguration baseProperty = (PropertyFileConfiguration) configs.get(i); globalConfig.insertConfiguration(baseProperty); final SystemPropertyConfiguration systemConfig = new SystemPropertyConfiguration(); globalConfig.insertConfiguration(systemConfig);
/** * Searches all property keys that start with a given prefix. * * @param prefix the prefix that all selected property keys should share * @return the properties as iterator. */ public Iterator findPropertyKeys(final String prefix) { final TreeSet keys = new TreeSet(); collectPropertyKeys(prefix, this, keys); return Collections.unmodifiableSet(keys).iterator(); }
/** * Returns the configuration property with the specified key. * * @param key the property key. * @return the property value. */ public String getConfigProperty(final String key) { return getConfigProperty(key, null); }
/** * Helper method for serialization. * * @param out the output stream where to write the object. * @throws java.io.IOException if errors occur while writing the stream. */ private void writeObject(final ObjectOutputStream out) throws IOException { out.defaultWriteObject(); if (isParentSaved() == false) { out.writeBoolean(false); } else { out.writeBoolean(true); out.writeObject(parentConfiguration); } }
/** * Helper method for serialization. * * @param in the input stream from where to read the serialized object. * @throws IOException when reading the stream fails. * @throws ClassNotFoundException if a class definition for a serialized * object could not be found. */ private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); final boolean readParent = in.readBoolean(); if (readParent) { parentConfiguration = (ModifiableConfiguration) in.readObject(); } else { parentConfiguration = null; } configurationLoaded(); }
/** * Returns the configuration property with the specified key (or the * specified default value if there is no such property). * <p> * If the property is not defined in this configuration, the code will * lookup the property in the parent configuration.</p> * * @param key the property key. * @param defaultValue the default value. * @return the property value. */ public String getConfigProperty(final String key, final String defaultValue) { String value = this.configuration.getProperty(key); if (value == null) { if (isRootConfig()) { value = defaultValue; } else { value = this.parentConfiguration.getConfigProperty(key, defaultValue); } } return value; }
/** * The new configuartion will be inserted into the list of report * configuration, so that this configuration has the given report * configuration instance as parent. * * @param config the new report configuration. */ public void insertConfiguration(final HierarchicalConfiguration config) { config.setParentConfig(getParentConfig()); setParentConfig(config); }
/** * Searches all property keys that start with a given prefix. * * @param prefix the prefix that all selected property keys should share * @return the properties as iterator. */ public Iterator findPropertyKeys(final String prefix) { final TreeSet keys = new TreeSet(); collectPropertyKeys(prefix, this, keys); return Collections.unmodifiableSet(keys).iterator(); }