/** * Create a new <code>DefaultConfiguration</code> with the specified * local name and location. * * @param localName a <code>String</code> value * @param location a <code>String</code> value * @return a <code>DefaultConfiguration</code> value */ protected DefaultConfiguration createConfiguration( final String localName, final String location ) { return new DefaultConfiguration( localName, location ); }
/** * Replace all properties in the configuration object. * @param tree The configuration. * @param settings The settings object to resolve the properties. */ public static Configuration replaceProperties(Configuration tree, Settings settings) throws ConfigurationException { if (tree == null || settings == null) { return tree; } // first clone the tree final DefaultConfiguration root = new DefaultConfiguration(tree, true); // now replace properties _replaceProperties(root, settings); return root; }
/** * Create a new <code>DefaultConfiguration</code> with the specified * local name, namespace, and location. * * @param localName a <code>String</code> value * @param namespaceURI a <code>String</code> value * @param location a <code>String</code> value * @return a <code>DefaultConfiguration</code> value */ protected DefaultConfiguration createConfiguration( final String localName, final String namespaceURI, final String location ) { String prefix = m_namespaceSupport.getPrefix( namespaceURI ); if( prefix == null ) { prefix = ""; } return new DefaultConfiguration( localName, location, namespaceURI, prefix ); }
/** * Return the first <code>Configuration</code> object child of this * associated with the given name. * * @param name the name of the child * @param createNew true if you want to create a new Configuration object if none exists * @return the child Configuration */ public Configuration getChild( final String name, final boolean createNew ) { final Configuration[] children = getChildren( name ); if( children.length > 0 ) { return children[ 0 ]; } else { if( createNew ) { return new DefaultConfiguration( name, "-" ); } else { return null; } } }
private Configuration getConfiguration() { if (symbol != null) { DefaultConfiguration cfg = new DefaultConfiguration("cfg"); DefaultConfiguration child = new DefaultConfiguration(symbol); cfg.addChild(child); return cfg; } if (configurationFile != null) { try { if (!configurationFile.exists() || !configurationFile.isFile()) { throw new BuildException("Config file not found: " + configurationFile); } log("Using configuration: " + configurationFile); DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder(); return builder.buildFromFile(configurationFile); } catch (Exception e) { throw new BuildException("Error reading configuration file: " + e.getMessage()); } } return new DefaultConfiguration("cfg"); }
return new DefaultConfiguration( name, "<generated>" + getLocation(), m_namespace, m_prefix );
private Configuration getConfiguration(CommandLine cl) { if (cl.hasOption("s")) { String sym = cl.getOptionValue("s"); DefaultConfiguration cfg = new DefaultConfiguration("cfg"); DefaultConfiguration child = new DefaultConfiguration(sym); cfg.addChild(child); return cfg; } if (cl.hasOption("c")) { try { String filename = cl.getOptionValue("c"); File cfgFile = new File(filename); if (!cfgFile.exists() || !cfgFile.isFile()) { throw new FileNotFoundException( "Config file not found: " + cfgFile); } log.info("Using configuration: " + cfgFile); DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder(); return builder.buildFromFile(cfgFile); } catch (Exception e) { exitHandler.failureExit(this, "Error reading configuration file: " + e.getMessage(), null, -3); } } return new DefaultConfiguration("cfg"); }
return new DefaultConfiguration( name, "<generated>" + getLocation(), m_namespace, m_prefix );
DefaultConfiguration config = new DefaultConfiguration( child );
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; }
new DefaultConfiguration( element.getLocalName(), element.getPrefix(), element.getNamespaceURI(), element.getPrefix() ); final NamedNodeMap attributes = element.getAttributes(); final int length = attributes.getLength();
new DefaultConfiguration( element.getNodeName(), "dom-created" ); final NamedNodeMap attributes = element.getAttributes(); final int length = attributes.getLength();
DefaultConfiguration cfg = new DefaultConfiguration("barcode"); DefaultConfiguration child = new DefaultConfiguration(type); cfg.addChild(child); String height = request.getParameter(BARCODE_HEIGHT); if (height != null) { attr = new DefaultConfiguration("height"); attr.setValue(height); child.addChild(attr); attr = new DefaultConfiguration("module-width"); attr.setValue(moduleWidth); child.addChild(attr); attr = new DefaultConfiguration("wide-factor"); attr.setValue(wideFactor); child.addChild(attr); attr = new DefaultConfiguration("quiet-zone"); if (quietZone.startsWith("disable")) { attr.setAttribute("enabled", "false"); && (humanReadableSize == null) && (humanReadableFont == null))) { attr = new DefaultConfiguration("human-readable"); subAttr = new DefaultConfiguration("pattern"); subAttr.setValue(pattern);
protected Configuration getAndCreateConfiguration(Configuration config, String name) { if (config.getChild(name, false) == null) { final DefaultConfiguration newConfig = new DefaultConfiguration(name, config.getLocation()); ((DefaultConfiguration) config).addChild(newConfig); } return config.getChild(name, false); }
public MutableConfiguration getMutableChild( final String name, boolean autoCreate ) throws ConfigurationException { Configuration child = getChild( name, false ); if( child == null ) { // No child. Create? if( autoCreate ) { DefaultConfiguration config = new DefaultConfiguration( name, "-" ); addChild( config ); return config; } else { return null; } } // Child exists return toMutable( child ); }
result = new DefaultConfiguration(ServiceConstants.ROLE_NAME); DefaultConfiguration containerFlavourConfig = new DefaultConfiguration( ServiceConstants.CONTAINERFLAVOUR_CONFIG_KEY); DefaultConfiguration containerClazzNameConfig = new DefaultConfiguration( ServiceConstants.CONTAINERCLAZZNAME_CONFIG_KEY); DefaultConfiguration componentRolesConfig = new DefaultConfiguration(ServiceConstants.COMPONENT_ROLE_KEYS); DefaultConfiguration componentRolesLocation = new DefaultConfiguration( ServiceConstants.COMPONENT_LOCATION_KEY); DefaultConfiguration componentRolesIsEncrypted = new DefaultConfiguration( ServiceConstants.COMPONENT_ISENCRYPTED_KEY); DefaultConfiguration componentConfigurationConfig = new DefaultConfiguration( ServiceConstants.COMPONENT_CONFIG_KEY); DefaultConfiguration componentConfigurationLocation = new DefaultConfiguration( ServiceConstants.COMPONENT_LOCATION_KEY); DefaultConfiguration componentConfigurationIsEncrypted = new DefaultConfiguration( ServiceConstants.COMPONENT_ISENCRYPTED_KEY); DefaultConfiguration parameterConfigurationConfig = new DefaultConfiguration( ServiceConstants.COMPONENT_PARAMETERS_KEY); DefaultConfiguration parameterConfigurationLocation = new DefaultConfiguration(
MutableConfiguration modifiedConf = new DefaultConfiguration(originalConf,true); MutableConfiguration cataloguesConf = modifiedConf.getMutableChild("catalogues", true); MutableConfiguration baseLocation = new DefaultConfiguration("location"); baseLocation.setValue(baseLocationPath); catalogueConf.addChild(baseLocation); MutableConfiguration aspectLocation = new DefaultConfiguration("location"); aspectLocation.setValue(aspectLocationPath); catalogueConf.addChild(aspectLocation);
addChild( new DefaultConfiguration( children[ i ], true ) );
DefaultConfiguration config = new DefaultConfiguration("sitemap"); config.setAttribute("file", sitemapURI);
componentConfig = new DefaultConfiguration("components", config.getLocation(), config.getNamespace(), final DefaultConfiguration c = new DefaultConfiguration(componentConfig.getName(), componentConfig.getLocation(), componentConfig.getNamespace(), includeElement = new DefaultConfiguration("include", c.getLocation(), c.getNamespace(),