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


Java ConfigurationException.printStackTrace方法代码示例

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


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

示例1: setPassword

import org.apache.commons.configuration2.ex.ConfigurationException; //导入方法依赖的package包/类
public void setPassword() {
	
	String content = passwordVar.getText();
	if (passwordVisibility){
		content = visPasswordVar.getText();
	}
	
	try {
		WorldConfig.savePassword(content);
	} catch (ConfigurationException e) {
		e.printStackTrace();
	}
	
	loadedPassword = content;
	log.debug("Done");
	showPassword();
}
 
开发者ID:ForJ-Latech,项目名称:fwm,代码行数:18,代码来源:JettyController.java

示例2: testOverride

import org.apache.commons.configuration2.ex.ConfigurationException; //导入方法依赖的package包/类
@Test
public void testOverride() {

    Parameters params = new Parameters();
    FileBasedConfigurationBuilder<FileBasedConfiguration> builder =
            new FileBasedConfigurationBuilder<FileBasedConfiguration>(PropertiesConfiguration.class)
                    .configure(params.properties()
                            .setFileName("file.properties"));
    Configuration config = null;
    try {
        config = builder.getConfiguration();
        config.setProperty("somekey", "somevalue");
        builder.save();
    } catch (ConfigurationException e) {
        e.printStackTrace();
    }
}
 
开发者ID:bejondshao,项目名称:personal,代码行数:18,代码来源:PropertyOverrideTest.java

示例3: addHotkey

import org.apache.commons.configuration2.ex.ConfigurationException; //导入方法依赖的package包/类
private static boolean addHotkey(KeyEvent event, String function) {
	String keyCombString = "";
	boolean modified = false;
	if (event.isShiftDown()) {
		modified = true;
		keyCombString += "Shift+";
	}
	if (event.isAltDown()) {
		modified = true;
		keyCombString += "Alt+";
	}
	if (event.isShortcutDown()) {
		modified = true;
		keyCombString += "Shortcut+";
	}
	keyCombString += event.getCode().getName();
	if (!event.getCode().isModifierKey() && modified) {
		hotkeys.get(function).setHotkey(keyCombString);
		try {
			saveHotkeys();
		} catch (ConfigurationException e) {
			e.printStackTrace();
		}
		return true;
	}
	return false;
}
 
开发者ID:ForJ-Latech,项目名称:fwm,代码行数:28,代码来源:HotkeyController.java

示例4: Config

import org.apache.commons.configuration2.ex.ConfigurationException; //导入方法依赖的package包/类
private Config() {
	Configuration configuration;
	try {
		Configurations configurations = new Configurations();

		configuration = configurations.properties(new File("configuration.properties"));
	} catch (ConfigurationException ce) {
		ce.printStackTrace();
		configuration = null;
	}
	this.properties = configuration;
	this.initSuccess = configuration != null;
}
 
开发者ID:PDDStudio,项目名称:phrase-java,代码行数:14,代码来源:Config.java

示例5: getStyleForMapFromProperties

import org.apache.commons.configuration2.ex.ConfigurationException; //导入方法依赖的package包/类
/**
 *
 * @return
 */
public static StyleList getStyleForMapFromProperties() {
    StyleList style = null;
    try {
        final Configuration config = FILE_BASED_CONFIGURATION_BUILDER.getConfiguration();
        final String styleName = config.getString(PropertyList.STYLE.toString());
        style = StyleList.valueOf(styleName);
    } catch (ConfigurationException cex) {
        LOGGER.error("\n" + cex.getCause());
        cex.printStackTrace();
    }
    return style;
}
 
开发者ID:Evegen55,项目名称:main_carauto_board,代码行数:17,代码来源:PropertiesHelper.java

示例6: getVideoFolderFromProperties

import org.apache.commons.configuration2.ex.ConfigurationException; //导入方法依赖的package包/类
public static String getVideoFolderFromProperties() {
    String videoFolder = null;
    try {
        final Configuration config = FILE_BASED_CONFIGURATION_BUILDER.getConfiguration();
        videoFolder = config.getString(PropertyList.VIDEO_FOLDER.toString());
    } catch (ConfigurationException cex) {
        LOGGER.error("\n" + cex.getCause());
        cex.printStackTrace();
    }
    return videoFolder;
}
 
开发者ID:Evegen55,项目名称:main_carauto_board,代码行数:12,代码来源:PropertiesHelper.java

示例7: setProperty

import org.apache.commons.configuration2.ex.ConfigurationException; //导入方法依赖的package包/类
public static void setProperty(final PropertyList property, final String value) {
    try {
        Configuration config = FILE_BASED_CONFIGURATION_BUILDER.getConfiguration();
        config.setProperty(property.toString(), value);
        FILE_BASED_CONFIGURATION_BUILDER.save();
    } catch (ConfigurationException cex) {
        LOGGER.error("\n" + cex.getCause());
        cex.printStackTrace();
    }
}
 
开发者ID:Evegen55,项目名称:main_carauto_board,代码行数:11,代码来源:PropertiesHelper.java

示例8: getDefaults

import org.apache.commons.configuration2.ex.ConfigurationException; //导入方法依赖的package包/类
/**
 * Returns a HashMap of the default values
 * @return
 */
public static PropertiesConfiguration getDefaults(){
	
	PropertiesConfiguration default_configuration = null;
	
	try {
		default_configuration = getDefaultParametersBuilder().getConfiguration();
	} catch (ConfigurationException e) {
		AptaLogger.log(Level.SEVERE, Configuration.class, e);
		e.printStackTrace();
	}
	
	return default_configuration;
	
}
 
开发者ID:drivenbyentropy,项目名称:aptasuite,代码行数:19,代码来源:Configuration.java

示例9: writeConfiguration

import org.apache.commons.configuration2.ex.ConfigurationException; //导入方法依赖的package包/类
/**
 * Writes the current configuration to file
 */
public static void writeConfiguration() {
	
	try {
		
		builder.save();
		AptaLogger.log(Level.CONFIG, Configuration.class, "Written Configuration file to " + builder.getFileHandler().getPath());
		
	} catch (ConfigurationException e) {
		
		// TODO Auto-generated catch block
		AptaLogger.log(Level.SEVERE, Configuration.class, e);
		e.printStackTrace();
		
	}
	
}
 
开发者ID:drivenbyentropy,项目名称:aptasuite,代码行数:20,代码来源:Configuration.java

示例10: getDefaultParametersBuilder

import org.apache.commons.configuration2.ex.ConfigurationException; //导入方法依赖的package包/类
private static BasicConfigurationBuilder<PropertiesConfiguration> getDefaultParametersBuilder(){
	
	// If we already have an instance, return it
	if(defaultBuilder != null) {
		
		return defaultBuilder;
		
	}
	
	// Create an in-memory configuration instance
	defaultBuilder = new BasicConfigurationBuilder<PropertiesConfiguration>(PropertiesConfiguration.class);
	
	PropertiesConfiguration config = null;
	
	try {
		
		config = defaultBuilder.getConfiguration();
		
		
	} catch (ConfigurationException e) {
		AptaLogger.log(Level.SEVERE, Configuration.class, e);
		e.printStackTrace();
	}
	
	// Fill it with the default configuration
	for (Entry<String, Object> item : defaults.entrySet()) {
		if (!config.containsKey(item.getKey())) {
			config.setProperty(item.getKey(), item.getValue());
		}
	}
	
	return defaultBuilder;
	
}
 
开发者ID:drivenbyentropy,项目名称:aptasuite,代码行数:35,代码来源:Configuration.java


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