當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。