/** * Set the value of this <code>Configuration</code> object to the specified boolean. * * @param value a <code>boolean</code> value */ public void setValue( final boolean value ) { setValue( String.valueOf( value ) ); }
/** * Set the value of this <code>Configuration</code> object to the specified long. * * @param value a <code>long</code> value */ public void setValue( final long value ) { setValue( String.valueOf( value ) ); }
/** * Set the value of this <code>Configuration</code> object to the specified float. * * @param value a <code>float</code> value */ public void setValue( final float value ) { setValue( String.valueOf( value ) ); }
/** * Set the value of this <code>Configuration</code> object to the specified double. * * @param value a <code>double</code> value */ public void setValue( final double value ) { setValue( String.valueOf( value ) ); }
/** * Set the value of this <code>Configuration</code> object to the specified int. * * @param value a <code>int</code> value */ public void setValue( final int value ) { setValue( String.valueOf( value ) ); }
private static DefaultConfiguration processElement(Element el) { String name = el.getLocalName(); if (name == null) { name = el.getTagName(); } DefaultConfiguration cfg = new DefaultConfiguration(name); NamedNodeMap atts = el.getAttributes(); for (int i = 0; i < atts.getLength(); i++) { Attr attr = (Attr)atts.item(i); cfg.setAttribute(attr.getName(), attr.getValue()); } for (int i = 0; i < el.getChildNodes().getLength(); i++) { Node node = el.getChildNodes().item(i); if (node.getNodeType() == Node.ATTRIBUTE_NODE) { Attr attr = (Attr)node; cfg.setAttribute(attr.getName(), attr.getNodeValue()); } else if (node.getNodeType() == Node.ELEMENT_NODE) { cfg.addChild(processElement((Element)node)); } else if (node.getNodeType() == Node.TEXT_NODE) { String s = cfg.getValue("") + ((Text)node).getData(); cfg.setValue(s.trim()); } else { //ignore } } return cfg; }
configuration.setValue( content );
finishedConfiguration.setValue( finishedValue );
finishedConfiguration.setValue( finishedValue );
configuration.setValue( content );
/** * Add all the attributes, children and value * from specified configuration element to current * configuration element. * * @param other the {@link Configuration} element */ public void addAll( final Configuration other ) { checkWriteable(); setValue( other.getValue( null ) ); addAllAttributes( other ); addAllChildren( other ); }
if (height != null) { attr = new DefaultConfiguration("height"); attr.setValue(height); child.addChild(attr); if (moduleWidth != null) { attr = new DefaultConfiguration("module-width"); attr.setValue(moduleWidth); child.addChild(attr); if (wideFactor != null) { attr = new DefaultConfiguration("wide-factor"); attr.setValue(wideFactor); child.addChild(attr); attr.setAttribute("enabled", "false"); } else { attr.setValue(quietZone); if (pattern != null) { subAttr = new DefaultConfiguration("pattern"); subAttr.setValue(pattern); attr.addChild(subAttr); subAttr.setValue(humanReadableSize); attr.addChild(subAttr); subAttr.setValue(humanReadableFont); attr.addChild(subAttr);
/** * Add all the attributes, children and value * from specified configuration element to current * configuration element. * * @param other the {@link Configuration} element * @param deepCopy true will cause clones of the children to be added, * false will add the original instances and is thus * faster. * * throws ConfigurationException If there are any problems cloning the * children. */ public void addAll( final Configuration other, final boolean deepCopy ) throws ConfigurationException { checkWriteable(); setValue( other.getValue( null ) ); addAllAttributes( other ); addAllChildren( other, deepCopy ); }
ServiceConstants.CONTAINERFLAVOUR_CONFIG_KEY); containerFlavourConfig.setValue(this.getContainerFlavour()); ServiceConstants.CONTAINERCLAZZNAME_CONFIG_KEY); containerClazzNameConfig.setValue(this.getServiceContainerClazzName()); ServiceConstants.COMPONENT_LOCATION_KEY); componentRolesLocation.setValue(this.getComponentRolesLocation()); componentRolesIsEncrypted.setValue(this.isComponentRolesEncrypted()); ServiceConstants.COMPONENT_LOCATION_KEY); componentConfigurationLocation.setValue(this.getComponentConfigurationLocation()); componentConfigurationIsEncrypted.setValue(this.isComponentConfigurationEncrypted()); ServiceConstants.COMPONENT_LOCATION_KEY); parameterConfigurationLocation.setValue(this.getParametersLocation()); parameterConfigurationIsEncrypted.setValue(this.isParametersEncrypted()); serviceManagerConfig.setValue(this.serviceManagerList[i]);
containerFlavourConfig.setValue( this.getContainerFlavour() ); containerClazzNameConfig.setValue( this.getServiceContainerClazzName() ); componentRolesLocation.setValue( this.getComponentRolesLocation() ); componentRolesIsEncrypted.setValue( this.isComponentRolesEncrypted() ); componentConfigurationLocation.setValue( this.getComponentConfigurationLocation() ); componentConfigurationIsEncrypted.setValue( this.isComponentConfigurationEncrypted() ); parameterConfigurationLocation.setValue( this.getParametersLocation() ); parameterConfigurationIsEncrypted.setValue( this.isParametersEncrypted() ); serviceManagerConfig.setValue(this.serviceManagerList[i]);
/** * Recursivly replace the properties of a configuration object. * @param config The configuration. * @param settings The settings object to resolve the properties. * @throws ConfigurationException */ protected static void _replaceProperties(DefaultConfiguration config, Settings settings) throws ConfigurationException { final String[] names = config.getAttributeNames(); for (int i = 0; i < names.length; i++) { final String value = config.getAttribute(names[i]); config.setAttribute(names[i], PropertyHelper.replace(value, settings)); } final String value = config.getValue(null); if (value != null) { config.setValue(PropertyHelper.replace(value, settings)); } final Configuration[] children = config.getChildren(); for (int m = 0; m < children.length; m++) { _replaceProperties((DefaultConfiguration) children[m], settings); } }
defaultConfiguration.setValue(newValue);
defaultConfiguration.setValue(newValue);