/** * Set the value of the specified attribute to the specified double. * * @param name name of the attribute to set * @param value an <code>double</code> value */ public void setAttribute( final String name, final double value ) { setAttribute( name, String.valueOf( value ) ); }
/** * Set the value of the specified attribute to the specified int. * * @param name name of the attribute to set * @param value an <code>int</code> value */ public void setAttribute( final String name, final int value ) { setAttribute( name, String.valueOf( value ) ); }
/** * Set the value of the specified attribute to the specified long. * * @param name name of the attribute to set * @param value an <code>long</code> value */ public void setAttribute( final String name, final long value ) { setAttribute( name, String.valueOf( value ) ); }
/** * Set the value of the specified attribute to the specified boolean. * * @param name name of the attribute to set * @param value an <code>boolean</code> value */ public void setAttribute( final String name, final boolean value ) { setAttribute( name, String.valueOf( value ) ); }
/** * Set the value of the specified attribute to the specified float. * * @param name name of the attribute to set * @param value an <code>float</code> value */ public void setAttribute( final String name, final float value ) { setAttribute( name, 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.setAttribute( name, value );
final String name = node.getNodeName(); final String value = node.getNodeValue(); configuration.setAttribute( name, value );
config.setAttribute("file", sitemapURI); if (checkReloadStr != null) { boolean checkReload = BooleanUtils.toBoolean(checkReloadStr); config.setAttribute("check-reload", checkReload); if (passThroughStr != null) { boolean passThrough = BooleanUtils.toBoolean(passThroughStr); config.setAttribute("pass-through", passThrough);
final String name = node.getNodeName(); final String value = node.getNodeValue(); configuration.setAttribute( name, value );
/** * Add all attributes from specified configuration * element to current configuration element. * * @param other the {@link Configuration} element */ public void addAllAttributes( final Configuration other ) { checkWriteable(); final String[] attributes = other.getAttributeNames(); for( int i = 0; i < attributes.length; i++ ) { final String name = attributes[ i ]; final String value = other.getAttribute( name, null ); setAttribute( name, value ); } }
configuration.setAttribute( name, value );
c.getNamespace(), ""); includeElement.setAttribute("dir", DEFAULT_CONFIG_XCONF); includeElement.setAttribute("pattern", "*.xconf"); includeElement.setAttribute("optional", "true"); c.addChild(includeElement);
/** * 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); } }
String oldAttributeValue = defaultConfiguration.getAttribute(attributeName); String newAttributeValue = ConfigurationUtil.expand(oldAttributeValue, vars); defaultConfiguration.setAttribute(attributeName, newAttributeValue);
String oldAttributeValue = defaultConfiguration.getAttribute(attributeName); String newAttributeValue = ConfigurationUtil.expand(oldAttributeValue, vars); defaultConfiguration.setAttribute(attributeName, newAttributeValue);
attr = new DefaultConfiguration("quiet-zone"); if (quietZone.startsWith("disable")) { attr.setAttribute("enabled", "false"); } else { attr.setValue(quietZone);