當前位置: 首頁>>代碼示例>>Java>>正文


Java DecompilerSettings.setRetainRedundantCasts方法代碼示例

本文整理匯總了Java中com.strobel.decompiler.DecompilerSettings.setRetainRedundantCasts方法的典型用法代碼示例。如果您正苦於以下問題:Java DecompilerSettings.setRetainRedundantCasts方法的具體用法?Java DecompilerSettings.setRetainRedundantCasts怎麽用?Java DecompilerSettings.setRetainRedundantCasts使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.strobel.decompiler.DecompilerSettings的用法示例。


在下文中一共展示了DecompilerSettings.setRetainRedundantCasts方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: loadConfig

import com.strobel.decompiler.DecompilerSettings; //導入方法依賴的package包/類
/**
 * Do not load, get the loaded instance
 */
private void loadConfig() {
    decompilerSettings = new DecompilerSettings();
    if (decompilerSettings.getJavaFormattingOptions() == null) {
        decompilerSettings.setJavaFormattingOptions(JavaFormattingOptions.createDefault());
    }
    luytenPreferences = new LuytenPreferences();
    mainWindowPosition = new WindowPosition();
    findWindowPosition = new WindowPosition();
    try {
        Preferences prefs = Preferences.userNodeForPackage(ConfigSaver.class);
        if (!prefs.get(LANGUAGE_NAME_ID, decompilerSettings.getLanguage().getName())
                .equals(decompilerSettings.getLanguage().getName()))
            prefs.put(LANGUAGE_NAME_ID, decompilerSettings.getLanguage().getName());

        decompilerSettings.setFlattenSwitchBlocks(
                prefs.getBoolean(FLATTEN_SWITCH_BLOCKS_ID, decompilerSettings.getFlattenSwitchBlocks()));
        decompilerSettings.setForceExplicitImports(
                prefs.getBoolean(FORCE_EXPLICIT_IMPORTS_ID, decompilerSettings.getForceExplicitImports()));
        decompilerSettings.setShowSyntheticMembers(
                prefs.getBoolean(SHOW_SYNTHETIC_MEMBERS_ID, decompilerSettings.getShowSyntheticMembers()));
        decompilerSettings.setExcludeNestedTypes(
                prefs.getBoolean(EXCLUDE_NESTED_TYPES_ID, decompilerSettings.getExcludeNestedTypes()));
        decompilerSettings.setForceExplicitTypeArguments(prefs.getBoolean(FORCE_EXPLICIT_TYPE_ARGUMENTS_ID,
                decompilerSettings.getForceExplicitTypeArguments()));
        decompilerSettings.setRetainRedundantCasts(
                prefs.getBoolean(RETAIN_REDUNDANT_CASTS_ID, decompilerSettings.getRetainRedundantCasts()));
        decompilerSettings.setIncludeErrorDiagnostics(
                prefs.getBoolean(INCLUDE_ERROR_DIAGNOSTICS_ID, decompilerSettings.getIncludeErrorDiagnostics()));
        decompilerSettings.setLanguage(
                findLanguageByName(prefs.get(LANGUAGE_NAME_ID, decompilerSettings.getLanguage().getName())));
        decompilerSettings.setUnicodeOutputEnabled(prefs.getBoolean(UNICODE_REPLACE_ENABLED_ID, false));

        mainWindowPosition = loadWindowPosition(prefs, MAIN_WINDOW_ID_PREFIX);
        findWindowPosition = loadWindowPosition(prefs, FIND_WINDOW_ID_PREFIX);
        luytenPreferences = loadLuytenPreferences(prefs);
    } catch (Exception e) {
        Luyten.showExceptionDialog("Exception!", e);
    }
}
 
開發者ID:hsswx7,項目名稱:CS4500GroupProject,代碼行數:43,代碼來源:ConfigSaver.java

示例2: loadConfig

import com.strobel.decompiler.DecompilerSettings; //導入方法依賴的package包/類
/**
 * Do not load, get the loaded instance
 */
private void loadConfig() {
	decompilerSettings = new DecompilerSettings();
	if (decompilerSettings.getJavaFormattingOptions() == null) {
		decompilerSettings.setJavaFormattingOptions(JavaFormattingOptions.createDefault());
	}
	luytenPreferences = new LuytenPreferences();
	mainWindowPosition = new WindowPosition();
	findWindowPosition = new WindowPosition();
	try {
		Preferences prefs = Preferences.userNodeForPackage(ConfigSaver.class);
		if (!prefs.get(LANGUAGE_NAME_ID, decompilerSettings.getLanguage().getName())
				.equals(decompilerSettings.getLanguage().getName()))
			prefs.put(LANGUAGE_NAME_ID, decompilerSettings.getLanguage().getName());

		decompilerSettings.setFlattenSwitchBlocks(
				prefs.getBoolean(FLATTEN_SWITCH_BLOCKS_ID, decompilerSettings.getFlattenSwitchBlocks()));
		decompilerSettings.setForceExplicitImports(
				prefs.getBoolean(FORCE_EXPLICIT_IMPORTS_ID, decompilerSettings.getForceExplicitImports()));
		decompilerSettings.setShowSyntheticMembers(
				prefs.getBoolean(SHOW_SYNTHETIC_MEMBERS_ID, decompilerSettings.getShowSyntheticMembers()));
		decompilerSettings.setExcludeNestedTypes(
				prefs.getBoolean(EXCLUDE_NESTED_TYPES_ID, decompilerSettings.getExcludeNestedTypes()));
		decompilerSettings.setForceExplicitTypeArguments(prefs.getBoolean(FORCE_EXPLICIT_TYPE_ARGUMENTS_ID,
				decompilerSettings.getForceExplicitTypeArguments()));
		decompilerSettings.setRetainRedundantCasts(
				prefs.getBoolean(RETAIN_REDUNDANT_CASTS_ID, decompilerSettings.getRetainRedundantCasts()));
		decompilerSettings.setIncludeErrorDiagnostics(
				prefs.getBoolean(INCLUDE_ERROR_DIAGNOSTICS_ID, decompilerSettings.getIncludeErrorDiagnostics()));
		decompilerSettings.setLanguage(
				findLanguageByName(prefs.get(LANGUAGE_NAME_ID, decompilerSettings.getLanguage().getName())));
		decompilerSettings.setUnicodeOutputEnabled(prefs.getBoolean(UNICODE_REPLACE_ENABLED_ID, false));

		mainWindowPosition = loadWindowPosition(prefs, MAIN_WINDOW_ID_PREFIX);
		findWindowPosition = loadWindowPosition(prefs, FIND_WINDOW_ID_PREFIX);
		luytenPreferences = loadLuytenPreferences(prefs);
	} catch (Exception e) {
		Luyten.showExceptionDialog("Exception!", e);
	}
}
 
開發者ID:KevinPriv,項目名稱:Luyten4Forge,代碼行數:43,代碼來源:ConfigSaver.java

示例3: cloneSettings

import com.strobel.decompiler.DecompilerSettings; //導入方法依賴的package包/類
private DecompilerSettings cloneSettings() {
	DecompilerSettings settings = ConfigSaver.getLoadedInstance().getDecompilerSettings();
	DecompilerSettings newSettings = new DecompilerSettings();
	if (newSettings.getJavaFormattingOptions() == null) {
		newSettings.setJavaFormattingOptions(JavaFormattingOptions.createDefault());
	}
	// synchronized: against main menu changes
	synchronized (settings) {
		newSettings.setExcludeNestedTypes(settings.getExcludeNestedTypes());
		newSettings.setFlattenSwitchBlocks(settings.getFlattenSwitchBlocks());
		newSettings.setForceExplicitImports(settings.getForceExplicitImports());
		newSettings.setForceExplicitTypeArguments(settings.getForceExplicitTypeArguments());
		newSettings.setOutputFileHeaderText(settings.getOutputFileHeaderText());
		newSettings.setLanguage(settings.getLanguage());
		newSettings.setShowSyntheticMembers(settings.getShowSyntheticMembers());
		newSettings.setAlwaysGenerateExceptionVariableForCatchBlocks(
				settings.getAlwaysGenerateExceptionVariableForCatchBlocks());
		newSettings.setOutputDirectory(settings.getOutputDirectory());
		newSettings.setRetainRedundantCasts(settings.getRetainRedundantCasts());
		newSettings.setIncludeErrorDiagnostics(settings.getIncludeErrorDiagnostics());
		newSettings.setIncludeLineNumbersInBytecode(settings.getIncludeLineNumbersInBytecode());
		newSettings.setRetainPointlessSwitches(settings.getRetainPointlessSwitches());
		newSettings.setUnicodeOutputEnabled(settings.isUnicodeOutputEnabled());
		newSettings.setMergeVariables(settings.getMergeVariables());
		newSettings.setShowDebugLineNumbers(settings.getShowDebugLineNumbers());
	}
	return newSettings;
}
 
開發者ID:KevinPriv,項目名稱:Luyten4Forge,代碼行數:29,代碼來源:FileSaver.java

示例4: getDecompilerSettings

import com.strobel.decompiler.DecompilerSettings; //導入方法依賴的package包/類
public DecompilerSettings getDecompilerSettings() {
    CommandLineOptions options = new CommandLineOptions();
    JCommander jCommander = new JCommander(options);
    String[] args = new String[Settings.values().length * 2];
    int index = 0;
    for (the.bytecode.club.bytecodeviewer.DecompilerSettings.Setting setting : Settings.values()) {
        args[index++] = "--" + setting.getParam();
        args[index++] = String.valueOf(getSettings().isSelected(setting));
    }
    jCommander.parse(args);
    DecompilerSettings settings = new DecompilerSettings();
    settings.setFlattenSwitchBlocks(options.getFlattenSwitchBlocks());
    settings.setForceExplicitImports(!options.getCollapseImports());
    settings.setForceExplicitTypeArguments(options.getForceExplicitTypeArguments());
    settings.setRetainRedundantCasts(options.getRetainRedundantCasts());
    settings.setShowSyntheticMembers(options.getShowSyntheticMembers());
    settings.setExcludeNestedTypes(options.getExcludeNestedTypes());
    settings.setOutputDirectory(options.getOutputDirectory());
    settings.setIncludeLineNumbersInBytecode(options.getIncludeLineNumbers());
    settings.setRetainPointlessSwitches(options.getRetainPointlessSwitches());
    settings.setUnicodeOutputEnabled(options.isUnicodeOutputEnabled());
    settings.setMergeVariables(options.getMergeVariables());
    settings.setShowDebugLineNumbers(options.getShowDebugLineNumbers());
    settings.setSimplifyMemberReferences(options.getSimplifyMemberReferences());
    settings.setDisableForEachTransforms(options.getDisableForEachTransforms());
    settings.setTypeLoader(new InputTypeLoader());
    if (options.isRawBytecode()) {
        settings.setLanguage(Languages.bytecode());
    } else if (options.isBytecodeAst()) {
        settings.setLanguage(options.isUnoptimized() ? Languages.bytecodeAstUnoptimized() : Languages.bytecodeAst());
    }
    return settings;
}
 
開發者ID:Konloch,項目名稱:bytecode-viewer,代碼行數:34,代碼來源:ProcyonDecompiler.java


注:本文中的com.strobel.decompiler.DecompilerSettings.setRetainRedundantCasts方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。