• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java DefaultListDelimiterHandler类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.commons.configuration2.convert.DefaultListDelimiterHandler的典型用法代码示例。如果您正苦于以下问题:Java DefaultListDelimiterHandler类的具体用法?Java DefaultListDelimiterHandler怎么用?Java DefaultListDelimiterHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DefaultListDelimiterHandler类属于org.apache.commons.configuration2.convert包,在下文中一共展示了DefaultListDelimiterHandler类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createPropertiesConfiguration

import org.apache.commons.configuration2.convert.DefaultListDelimiterHandler; //导入依赖的package包/类
private static FileBasedConfiguration createPropertiesConfiguration(Reader reader)
    throws ConfigurationException, IOException {
  if (reader == null) {
    throw new NullPointerException("reader: null");
  }

  FileBasedConfigurationBuilder<FileBasedConfiguration> builder =
      new FileBasedConfigurationBuilder<FileBasedConfiguration>(PropertiesConfiguration.class)
          .configure(new Parameters()
              .properties()
              .setListDelimiterHandler(new DefaultListDelimiterHandler(',')));

  FileBasedConfiguration config = builder.getConfiguration();
  config.read(reader);
  return config;
}
 
开发者ID:cerner,项目名称:beadledom,代码行数:17,代码来源:PropertiesConfigurationSource.java


示例2: ConfigurationManager

import org.apache.commons.configuration2.convert.DefaultListDelimiterHandler; //导入依赖的package包/类
private ConfigurationManager() throws ConfigurationException{
	FileBasedConfigurationBuilder<PropertiesConfiguration> builder =
		new FileBasedConfigurationBuilder<PropertiesConfiguration>(PropertiesConfiguration.class)
			.configure(new Parameters().properties()
			.setFileName(configFilePath)
			.setThrowExceptionOnMissing(true)
			.setListDelimiterHandler(new DefaultListDelimiterHandler(';'))
			.setIncludesAllowed(false));
	config = builder.getConfiguration();
}
 
开发者ID:datancoffee,项目名称:sirocco,代码行数:11,代码来源:ConfigurationManager.java


示例3: init

import org.apache.commons.configuration2.convert.DefaultListDelimiterHandler; //导入依赖的package包/类
private void init()
{
	this.setListDelimiterHandler(new DefaultListDelimiterHandler(','));
	FileLocationStrategy strategy = new MyFileLocationStrategy();
	String basePath = _fileName == null ? "." : new File(_fileName).getParent();
	FileLocator locator = FileLocatorUtils.fileLocator()
			.locationStrategy(strategy)
			.basePath(basePath)
			.create();
	this.initFileLocator(locator);
}
 
开发者ID:yajsw,项目名称:yajsw,代码行数:12,代码来源:FilePropertiesConfiguration.java


示例4: Swagger2MarkupConfigBuilder

import org.apache.commons.configuration2.convert.DefaultListDelimiterHandler; //导入依赖的package包/类
public Swagger2MarkupConfigBuilder(Configuration configuration) {
    CompositeConfiguration compositeConfiguration = new CompositeConfiguration();
    compositeConfiguration.addConfiguration(new SystemConfiguration());
    compositeConfiguration.addConfiguration(configuration);
    compositeConfiguration.addConfiguration(getDefaultConfiguration());

    Swagger2MarkupProperties swagger2MarkupProperties = new Swagger2MarkupProperties(compositeConfiguration);

    config.listDelimiterEnabled = swagger2MarkupProperties.getBoolean(LIST_DELIMITER_ENABLED, false);
    config.listDelimiter = swagger2MarkupProperties.getString(LIST_DELIMITER, ",").charAt(0);
    
    if (config.listDelimiterEnabled && configuration instanceof AbstractConfiguration) {
        ((AbstractConfiguration)configuration).setListDelimiterHandler(new DefaultListDelimiterHandler(config.listDelimiter));
    }

    config.markupLanguage = swagger2MarkupProperties.getRequiredMarkupLanguage(MARKUP_LANGUAGE);
    config.swaggerMarkupLanguage = swagger2MarkupProperties.getRequiredMarkupLanguage(SWAGGER_MARKUP_LANGUAGE);
    config.generatedExamplesEnabled = swagger2MarkupProperties.getRequiredBoolean(GENERATED_EXAMPLES_ENABLED);
    config.basePathPrefixEnabled = swagger2MarkupProperties.getRequiredBoolean(BASE_PATH_PREFIX_ENABLED);
    config.separatedDefinitionsEnabled = swagger2MarkupProperties.getRequiredBoolean(SEPARATED_DEFINITIONS_ENABLED);
    config.separatedOperationsEnabled = swagger2MarkupProperties.getRequiredBoolean(SEPARATED_OPERATIONS_ENABLED);
    config.pathsGroupedBy = swagger2MarkupProperties.getGroupBy(PATHS_GROUPED_BY);
    config.outputLanguage = swagger2MarkupProperties.getLanguage(OUTPUT_LANGUAGE);
    config.inlineSchemaEnabled = swagger2MarkupProperties.getRequiredBoolean(INLINE_SCHEMA_ENABLED);
    config.interDocumentCrossReferencesEnabled = swagger2MarkupProperties.getRequiredBoolean(INTER_DOCUMENT_CROSS_REFERENCES_ENABLED);
    config.interDocumentCrossReferencesPrefix = swagger2MarkupProperties.getString(INTER_DOCUMENT_CROSS_REFERENCES_PREFIX, null);
    config.flatBodyEnabled = swagger2MarkupProperties.getRequiredBoolean(FLAT_BODY_ENABLED);
    config.pathSecuritySectionEnabled = swagger2MarkupProperties.getRequiredBoolean(PATH_SECURITY_SECTION_ENABLED);
    config.anchorPrefix = swagger2MarkupProperties.getString(ANCHOR_PREFIX, null);
    config.overviewDocument = swagger2MarkupProperties.getRequiredString(OVERVIEW_DOCUMENT);
    config.pathsDocument = swagger2MarkupProperties.getRequiredString(PATHS_DOCUMENT);
    config.definitionsDocument = swagger2MarkupProperties.getRequiredString(DEFINITIONS_DOCUMENT);
    config.securityDocument = swagger2MarkupProperties.getRequiredString(SECURITY_DOCUMENT);
    config.separatedOperationsFolder = swagger2MarkupProperties.getRequiredString(SEPARATED_OPERATIONS_FOLDER);
    config.separatedDefinitionsFolder = swagger2MarkupProperties.getRequiredString(SEPARATED_DEFINITIONS_FOLDER);
    config.tagOrderBy = swagger2MarkupProperties.getOrderBy(TAG_ORDER_BY);
    config.operationOrderBy = swagger2MarkupProperties.getOrderBy(OPERATION_ORDER_BY);
    config.definitionOrderBy = swagger2MarkupProperties.getOrderBy(DEFINITION_ORDER_BY);
    config.parameterOrderBy = swagger2MarkupProperties.getOrderBy(PARAMETER_ORDER_BY);
    config.propertyOrderBy = swagger2MarkupProperties.getOrderBy(PROPERTY_ORDER_BY);
    config.responseOrderBy = swagger2MarkupProperties.getOrderBy(RESPONSE_ORDER_BY);
    Optional<String> lineSeparator = swagger2MarkupProperties.getString(LINE_SEPARATOR);
    if (lineSeparator.isPresent() && StringUtils.isNoneBlank(lineSeparator.get())) {
        config.lineSeparator = LineSeparator.valueOf(lineSeparator.get());
    }

    config.pageBreakLocations = swagger2MarkupProperties.getPageBreakLocations(PAGE_BREAK_LOCATIONS);

    Optional<Pattern> headerPattern = swagger2MarkupProperties.getHeaderPattern(HEADER_REGEX);

    config.headerPattern = headerPattern.orElse(null);
    
    Configuration swagger2markupConfiguration = compositeConfiguration.subset(PROPERTIES_PREFIX);
    Configuration extensionsConfiguration = swagger2markupConfiguration.subset(EXTENSION_PREFIX);
    config.extensionsProperties = new Swagger2MarkupProperties(extensionsConfiguration);
}
 
开发者ID:Swagger2Markup,项目名称:swagger2markup,代码行数:57,代码来源:Swagger2MarkupConfigBuilder.java


示例5: setConfiguration

import org.apache.commons.configuration2.convert.DefaultListDelimiterHandler; //导入依赖的package包/类
/**
 * Adds the configuration stored on disk to the current set of parameters. The
 * file <code>fileName</code> must be a valid configuration file as per Javas
 * <code>Properties</code> class.
 * 
 * @param fileName
 */
public static void setConfiguration(String fileName) {

	try {
		AptaLogger.log(Level.INFO, Configuration.class, "Reading configuration from file.");

		builder = new FileBasedConfigurationBuilder<org.apache.commons.configuration2.FileBasedConfiguration>(
				PropertiesConfiguration.class)
						.configure(new Parameters().properties().setFileName(fileName)
								.setListDelimiterHandler(new DefaultListDelimiterHandler(',')));

		
		// Create a composite configuration which allows to keep user parameters and defaults separated
		CompositeConfiguration  cc = new CompositeConfiguration(); 
		
		cc.addConfiguration(builder.getConfiguration(), true); // changes will be saved in the user config
		cc.addConfiguration(getDefaultParametersBuilder().getConfiguration(), false);
					
		parameters = cc;
		
	} catch (Exception e) {

		AptaLogger.log(Level.SEVERE, Configuration.class,
				"Error, could not read configuration file. Please check it for correctness");
		AptaLogger.log(Level.SEVERE, Configuration.class, e);
		e.printStackTrace();
	}


	// TODO: Sanity checks!
}
 
开发者ID:drivenbyentropy,项目名称:aptasuite,代码行数:38,代码来源:Configuration.java


示例6: createConfiguration

import org.apache.commons.configuration2.convert.DefaultListDelimiterHandler; //导入依赖的package包/类
/**
 * Creates an empty configuration and configures the class 
 * @param filename location at which the config should be stored in the future
 */
public static void createConfiguration(Path filePath) {
	
	try {
		
		builder = new FileBasedConfigurationBuilder<FileBasedConfiguration>(PropertiesConfiguration.class)
		    .configure(new Parameters().properties()
		        //.setFile(filePath.toFile())
		        .setListDelimiterHandler(new DefaultListDelimiterHandler(',')));
		
		org.apache.commons.configuration2.Configuration userParameters = builder.getConfiguration();
		

		//We need to explicitly save the file before setting it in the builder, for whatever reason...
		builder.getFileHandler().save(filePath.toFile());
		builder.getFileHandler().setFile(filePath.toFile());
		
		// Create a composite configuration which allows to keep user parameters and defaults separated
		CompositeConfiguration  cc = new CompositeConfiguration();
		
		cc.addConfiguration(builder.getConfiguration(), true); // changes will be saved in the user config
		cc.addConfiguration(getDefaultParametersBuilder().getConfiguration(), false);
		
		parameters = cc;
		
	} catch (Exception e) {

		AptaLogger.log(Level.SEVERE, Configuration.class,
				"Error, could not create configuration file.");
		AptaLogger.log(Level.SEVERE, Configuration.class, e);
		e.printStackTrace();
	}

}
 
开发者ID:drivenbyentropy,项目名称:aptasuite,代码行数:38,代码来源:Configuration.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Food类代码示例发布时间:2022-05-22
下一篇:
Java GenericPool类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap