本文整理汇总了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();
}
示例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();
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
}
示例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;
}
示例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();
}
}
示例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;
}