当前位置: 首页>>代码示例>>Java>>正文


Java XMLConfiguration.setDelimiterParsingDisabled方法代码示例

本文整理汇总了Java中org.apache.commons.configuration.XMLConfiguration.setDelimiterParsingDisabled方法的典型用法代码示例。如果您正苦于以下问题:Java XMLConfiguration.setDelimiterParsingDisabled方法的具体用法?Java XMLConfiguration.setDelimiterParsingDisabled怎么用?Java XMLConfiguration.setDelimiterParsingDisabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.commons.configuration.XMLConfiguration的用法示例。


在下文中一共展示了XMLConfiguration.setDelimiterParsingDisabled方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadExtraConfigration

import org.apache.commons.configuration.XMLConfiguration; //导入方法依赖的package包/类
@Override
protected boolean loadExtraConfigration() throws IOException {
    try {
        XMLConfiguration config = new XMLConfiguration();
        config.setDelimiterParsingDisabled(true);
        config.load(getConfigFile());

        for (Object obj : config.getRootNode().getChildren()) {
            Node node = (Node) obj;
            if (node.getName().equals(KEY_RELATED_LSP_FIELD_NAME)) {
                setRelatedRsvplspFieldName((String) node.getValue());
                return true;
            }
        }
    } catch (ConfigurationException e) {
        log.error(e.getMessage(), e);
        throw new IOException("failed to reload config: " + getConfigFile());
    }
    return false;
}
 
开发者ID:openNaEF,项目名称:openNaEF,代码行数:21,代码来源:NmsCorePseudoWireConfiguration.java

示例2: loadExtraConfigration

import org.apache.commons.configuration.XMLConfiguration; //导入方法依赖的package包/类
@Override
protected boolean loadExtraConfigration() throws IOException {
    try {
        XMLConfiguration config = new XMLConfiguration();
        config.setDelimiterParsingDisabled(true);
        config.load(getConfigFile());

        for (Object obj : config.getRootNode().getChildren()) {
            Node node = (Node) obj;
            if (node.getName().equals(KEY_HOP_IP_PATH_FIELD_NAME)) {
                List<String> values = new ArrayList<String>();

                for (Object value : node.getChildren()) {
                    values.add((String) ((Node) value).getValue());
                }
                setHopIpPathFieldsName(values);
                return true;
            }
        }
    } catch (ConfigurationException e) {
        log.error(e.getMessage(), e);
        throw new IOException("failed to reload config: " + getConfigFile());
    }
    return false;
}
 
开发者ID:openNaEF,项目名称:openNaEF,代码行数:26,代码来源:NmsCoreRsvpLspConfiguration.java

示例3: reloadConfigurationInner

import org.apache.commons.configuration.XMLConfiguration; //导入方法依赖的package包/类
@Override
protected synchronized void reloadConfigurationInner() throws IOException {
    try {
        XMLConfiguration config = new XMLConfiguration();
        config.setDelimiterParsingDisabled(true);
        config.load(getConfigFile());

        String __isSystemUserUpdateEnabled = config.getString(KEY_ENABLE_SYSTEM_USER_UPDATE);
        boolean _isSystemUserUpdateEnabled = (__isSystemUserUpdateEnabled == null ? false :
                Boolean.parseBoolean(__isSystemUserUpdateEnabled));

        this.isSystemUserUpdateEnabled = _isSystemUserUpdateEnabled;

        log().info("isSystemUserUpdateEnabled=" + this.isSystemUserUpdateEnabled);
        log().info("reload finished.");
    } catch (ConfigurationException e) {
        log().error(e.getMessage(), e);
        throw new IOException("failed to reload config: " + FILE_NAME);
    }
}
 
开发者ID:openNaEF,项目名称:openNaEF,代码行数:21,代码来源:BuilderConfiguration.java

示例4: load

import org.apache.commons.configuration.XMLConfiguration; //导入方法依赖的package包/类
/**
 * Loads and parse CME MDP Configuration.
 *
 * @param uri URI to CME MDP Configuration (config.xml, usually available on CME FTP)
 * @throws ConfigurationException if failed to parse configuration file
 * @throws MalformedURLException  if URI to Configuration is malformed
 */
private void load(final URI uri) throws ConfigurationException, MalformedURLException {
    // todo: if to implement the same via standard JAXB then dep to apache commons configuration will be not required
    final XMLConfiguration configuration = new XMLConfiguration();
    configuration.setDelimiterParsingDisabled(true);
    configuration.load(uri.toURL());
    for (final HierarchicalConfiguration channelCfg : configuration.configurationsAt("channel")) {
        final ChannelCfg channel = new ChannelCfg(channelCfg.getString("[@id]"), channelCfg.getString("[@label]"));

        for (final HierarchicalConfiguration connCfg : channelCfg.configurationsAt("connections.connection")) {
            final String id = connCfg.getString("[@id]");
            final FeedType type = FeedType.valueOf(connCfg.getString("type[@feed-type]"));
            final TransportProtocol protocol = TransportProtocol.valueOf(connCfg.getString("protocol").substring(0, 3));
            final Feed feed = Feed.valueOf(connCfg.getString("feed"));
            final String ip = connCfg.getString("ip");
            final int port = connCfg.getInt("port");
            final List<String> hostIPs = Arrays.asList(connCfg.getStringArray("host-ip"));

            final ConnectionCfg connection = new ConnectionCfg(feed, id, type, protocol, ip, hostIPs, port);
            channel.addConnection(connection);
            connCfgs.put(connection.getId(), connection);
        }
        channelCfgs.put(channel.getId(), channel);
    }
}
 
开发者ID:epam,项目名称:java-cme-mdp3-handler,代码行数:32,代码来源:Configuration.java

示例5: loadRegexAlerts

import org.apache.commons.configuration.XMLConfiguration; //导入方法依赖的package包/类
public static Map<String, JSONObject> loadRegexAlerts(String config_path)
		throws ConfigurationException, ParseException {
	XMLConfiguration alert_rules = new XMLConfiguration();
	alert_rules.setDelimiterParsingDisabled(true);
	alert_rules.load(config_path);

	//int number_of_rules = alert_rules.getList("rule.pattern").size();

	String[] patterns = alert_rules.getStringArray("rule.pattern");
	String[] alerts = alert_rules.getStringArray("rule.alert");

	JSONParser pr = new JSONParser();
	Map<String, JSONObject> rules = new HashMap<String, JSONObject>();

	for (int i = 0; i < patterns.length; i++)
		rules.put(patterns[i], (JSONObject) pr.parse(alerts[i]));

	return rules;
}
 
开发者ID:apache,项目名称:metron,代码行数:20,代码来源:SettingsLoader.java

示例6: getApplicationDescription

import org.apache.commons.configuration.XMLConfiguration; //导入方法依赖的package包/类
/**
 * Loads the application descriptor from the specified application archive
 * stream and saves the stream in the appropriate application archive
 * directory.
 *
 * @param appName application name
 * @return application descriptor
 * @throws org.onosproject.app.ApplicationException if unable to read application description
 */
public ApplicationDescription getApplicationDescription(String appName) {
    try {
        XMLConfiguration cfg = new XMLConfiguration();
        cfg.setAttributeSplittingDisabled(true);
        cfg.setDelimiterParsingDisabled(true);
        cfg.load(appFile(appName, APP_XML));
        return loadAppDescription(cfg);
    } catch (Exception e) {
        throw new ApplicationException("Unable to get app description", e);
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:21,代码来源:ApplicationArchive.java

示例7: parsePlainAppDescription

import org.apache.commons.configuration.XMLConfiguration; //导入方法依赖的package包/类
private ApplicationDescription parsePlainAppDescription(InputStream stream)
        throws IOException {
    XMLConfiguration cfg = new XMLConfiguration();
    cfg.setAttributeSplittingDisabled(true);
    cfg.setDelimiterParsingDisabled(true);
    try {
        cfg.load(stream);
        return loadAppDescription(cfg);
    } catch (ConfigurationException e) {
        throw new IOException("Unable to parse " + APP_XML, e);
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:13,代码来源:ApplicationArchive.java

示例8: reloadConfigurationInner

import org.apache.commons.configuration.XMLConfiguration; //导入方法依赖的package包/类
@Override
protected void reloadConfigurationInner() throws IOException {
    try {
        XMLConfiguration config = new XMLConfiguration();
        config.setDelimiterParsingDisabled(true);
        config.load(getConfigFile());

        log.debug("loading config:" + getConfigName());

        for (Object obj : config.getRootNode().getChildren()) {
            Node node = (Node) obj;

            if (node.getName().equals(KEY_DISPATCHER_IP_ADDRESS)) {
                List<String> values = new ArrayList<String>();

                for (Object value : node.getChildren()) {
                    values.add((String) ((Node) value).getValue());
                }
                setDispatcherIpAddress(values);
            } else {
                log.info("unknown node:" + node.getName());
            }

        }
    } catch (ConfigurationException e) {
        log.error(e.getMessage(), e);
        throw new IOException("failed to reload config: " + getConfigFile());
    }

}
 
开发者ID:openNaEF,项目名称:openNaEF,代码行数:31,代码来源:NmsCoreCommonConfiguration.java

示例9: reloadConfigurationInner

import org.apache.commons.configuration.XMLConfiguration; //导入方法依赖的package包/类
@Override
protected synchronized void reloadConfigurationInner() throws IOException {
    try {
        config = new XMLConfiguration();
        config.setDelimiterParsingDisabled(true);
        config.load(getConfigFile());
        this.inventoryRmiServicePort = config.getInt(INVENTORY_RMI_SERVICE_PORT);
        log().info("reload finished.");
    } catch (ConfigurationException e) {
        log().error(e.getMessage(), e);
        throw new IOException("failed to reload config: " + FILE_NAME);
    }
}
 
开发者ID:openNaEF,项目名称:openNaEF,代码行数:14,代码来源:MplsNmsConfiguration.java

示例10: read

import org.apache.commons.configuration.XMLConfiguration; //导入方法依赖的package包/类
public static XMLConfiguration read(String src) {
	try {
		// remove all namespaces from xml
		src = removeNSAndPreamble(src);
		XMLConfiguration config = new XMLConfiguration();
		config.setDelimiterParsingDisabled(true);
		config.load(new ByteArrayInputStream(src.getBytes()));
		config.setExpressionEngine(new XPathExpressionEngine());
		return config;

	} catch (ConfigurationException e) {
		throw new RuntimeException(e);
	}
}
 
开发者ID:qmetry,项目名称:qaf,代码行数:15,代码来源:XPathUtils.java

示例11: loadAppDescription

import org.apache.commons.configuration.XMLConfiguration; //导入方法依赖的package包/类
private ApplicationDescription loadAppDescription(XMLConfiguration cfg) {
    cfg.setAttributeSplittingDisabled(true);
    cfg.setDelimiterParsingDisabled(true);
    String name = cfg.getString(NAME);
    Version version = Version.version(cfg.getString(VERSION));
    String desc = cfg.getString(DESCRIPTION);
    String origin = cfg.getString(ORIGIN);
    Set<Permission> perms = ImmutableSet.of();
    String featRepo = cfg.getString(FEATURES_REPO);
    URI featuresRepo = featRepo != null ? URI.create(featRepo) : null;
    List<String> features = ImmutableList.copyOf(cfg.getStringArray(FEATURES));

    return new DefaultApplicationDescription(name, version, desc, origin,
                                             perms, featuresRepo, features);
}
 
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:16,代码来源:ApplicationArchive.java

示例12: getConfiguration

import org.apache.commons.configuration.XMLConfiguration; //导入方法依赖的package包/类
private XMLConfiguration getConfiguration() {
	XMLConfiguration configuration = new XMLConfiguration();
	configuration.setDelimiterParsingDisabled(true);
	return configuration;
}
 
开发者ID:dream-lab,项目名称:goffish_v2,代码行数:6,代码来源:GMLPartitionBuilder.java


注:本文中的org.apache.commons.configuration.XMLConfiguration.setDelimiterParsingDisabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。