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


Java ObjectMappingException.printStackTrace方法代碼示例

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


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

示例1: SignsConfig

import ninja.leaping.configurate.objectmapping.ObjectMappingException; //導入方法依賴的package包/類
public SignsConfig(File baseDir) {
    super(baseDir, "signs");

    for (Object objKey : config.getChildrenMap().keySet()) {
        if (objKey instanceof String) {
            String key = (String) objKey;
            if (Utils.isInt(key)) {
                Set<DonorSign> signs = new HashSet<>();
                System.out.println("key " + key);
                try {
                    for (Location<World> loc : stringsToLocArray(config.getChildrenMap().get(objKey).getList(TypeToken.of(String.class)))) {
                        if (loc != null && loc.getTileEntity().isPresent() && loc.getTileEntity().get() instanceof Sign) {
                            System.out.println("2");
                            signs.add(new DonorSign(Utils.getInt(key), loc));
                        }
                    }
                } catch (ObjectMappingException e) {
                    e.printStackTrace();
                }
                donorSigns.put(Utils.getInt(key), signs);
            }
        }
    }
}
 
開發者ID:MinecraftMarket,項目名稱:MinecraftMarket-Plugin,代碼行數:25,代碼來源:SignsConfig.java

示例2: setInternalValue

import ninja.leaping.configurate.objectmapping.ObjectMappingException; //導入方法依賴的package包/類
private <T> void setInternalValue(T storageHandler) {
    if (storageHandler instanceof ConfigurationNode) {
        ConfigurationNode node = ((ConfigurationNode) storageHandler).getNode(this.key.get());
        if (this.comment != null && node instanceof CommentedConfigurationNode) {
            ((CommentedConfigurationNode) node).setComment(this.comment);
        }

        if (this.modified) {
            if (this.valueTypeToken != null) {
                try {
                    node.setValue(this.valueTypeToken, this.value);
                } catch (ObjectMappingException e) {
                    e.printStackTrace();
                }
            } else {
                node.setValue(this.value);
            }
            this.modified = false;
        }
    }
}
 
開發者ID:ichorpowered,項目名稱:elderguardian,代碼行數:22,代碼來源:StorageValue.java

示例3: init

import ninja.leaping.configurate.objectmapping.ObjectMappingException; //導入方法依賴的package包/類
public static void init() {
    Logger logger = WebAPI.getLogger();

    logger.info("Loading users...");
    Tuple<ConfigurationLoader, ConfigurationNode> tup =
            Util.loadWithDefaults(configFileName, "defaults/" + configFileName);
    loader = tup.getFirst();
    config = tup.getSecond();

    users.clear();

    try {
        Map<Object, ? extends ConfigurationNode> nodes = config.getNode("users").getChildrenMap();
        for (Map.Entry<Object, ? extends ConfigurationNode> entry : nodes.entrySet()) {
            UserPermission perm = entry.getValue().getValue(TypeToken.of(UserPermission.class));
            users.put(perm.getUsername(), perm);
        }
    } catch (ObjectMappingException e) {
        e.printStackTrace();
    }
}
 
開發者ID:Valandur,項目名稱:Web-API,代碼行數:22,代碼來源:Users.java

示例4: saveDefaultConfig

import ninja.leaping.configurate.objectmapping.ObjectMappingException; //導入方法依賴的package包/類
/**
 * Saves a config file with default values if it does not already exist
 *
 */
private void saveDefaultConfig() {
    try {
        this.logger.info("Generating config file...");
        this.configFile.getParentFile().mkdirs();
        this.configFile.createNewFile();
        CommentedConfigurationNode configNode = this.configLoader.load();

        try {
            // Populate config with default values
            config = Config.MAPPER.bindToNew().populate(configNode);
            Config.MAPPER.bind(config).serialize(configNode);
        } catch (ObjectMappingException e) {
            e.printStackTrace();
        }

        // Remove config settings only intended for development
        configNode.getNode("badgeup").removeChild("base-api-url");
        configNode.getNode("badgeup").removeChild("event-pool-connections");

        this.configLoader.save(configNode);
        this.logger.info("Config file successfully generated.");
    } catch (IOException exception) {
        this.logger.warn("The default configuration could not be created!");
    }
}
 
開發者ID:BadgeUp,項目名稱:badgeup-sponge-client,代碼行數:30,代碼來源:BadgeUpSponge.java

示例5: getDefFlagsValues

import ninja.leaping.configurate.objectmapping.ObjectMappingException; //導入方法依賴的package包/類
public HashMap<String, Object> getDefFlagsValues(){
   	HashMap<String,Object> flags = new HashMap<>();
   	for (Object oflag:getNodes("flags").getChildrenMap().keySet()/*getList(TypeToken.of(String.class)*/){
   		if (oflag instanceof String && isFlagEnabled(((String)oflag).replace("flags.", ""))){
   			String flag = (String)oflag;
   			try {
				if (flag.equals("pvp") && !getNodes("flags-configuration.enabled-flags").getList(TypeToken.of(String.class)).contains("pvp")){
					continue;
				}
			} catch (ObjectMappingException e) {
				e.printStackTrace();
			}
   			flags.put(flag, getNodes("flags."+flag).getValue());
   		}
   	}    	
	return flags;
}
 
開發者ID:FabioZumbi12,項目名稱:RedProtect,代碼行數:18,代碼來源:RPConfig.java

示例6: saveDefaultConfig

import ninja.leaping.configurate.objectmapping.ObjectMappingException; //導入方法依賴的package包/類
/**
 * Saves a config file with default values if it does not already exist
 *
 * @return true if default config was successfully created, false if the
 *         file was not created
 */
private void saveDefaultConfig() {
    try {
        this.logger.info("Generating config file...");
        this.configFile.getParentFile().mkdirs();
        this.configFile.createNewFile();
        CommentedConfigurationNode rawConfig = this.configLoader.load();

        try {
            // Populate config with default values
            this.config = BLWarpsConfiguration.MAPPER.bindToNew().populate(rawConfig);
            BLWarpsConfiguration.MAPPER.bind(this.config).serialize(rawConfig);
        } catch (ObjectMappingException e) {
            e.printStackTrace();
        }

        this.configLoader.save(rawConfig);
        this.logger.info("Config file successfully generated.");
    } catch (IOException exception) {
        this.logger.warn("The default configuration could not be created!");
    }
}
 
開發者ID:RobertHerhold,項目名稱:BLWarps,代碼行數:28,代碼來源:BLWarps.java

示例7: ConfigManager

import ninja.leaping.configurate.objectmapping.ObjectMappingException; //導入方法依賴的package包/類
public ConfigManager(ConfigurationLoader<CommentedConfigurationNode> loader) {
	this.loader = loader;
	try {
		this.configMapper = ObjectMapper.forObject(PLUGIN.getConfig());
	} catch (ObjectMappingException e) {
		e.printStackTrace();
	}

	this.load();
}
 
開發者ID:DevOnTheRocks,項目名稱:StickyChunk,代碼行數:11,代碼來源:ConfigManager.java

示例8: SignsLayoutConfig

import ninja.leaping.configurate.objectmapping.ObjectMappingException; //導入方法依賴的package包/類
public SignsLayoutConfig(File baseDir) {
    super(baseDir, "signsLayout");

    try {
        activeLayout = config.getNode("Active").getList(TypeToken.of(String.class));
        waitingLayout = config.getNode("Waiting").getList(TypeToken.of(String.class));
    } catch (ObjectMappingException e) {
        e.printStackTrace();
    }
}
 
開發者ID:MinecraftMarket,項目名稱:MinecraftMarket-Plugin,代碼行數:11,代碼來源:SignsLayoutConfig.java

示例9: serializeDefault

import ninja.leaping.configurate.objectmapping.ObjectMappingException; //導入方法依賴的package包/類
public void serializeDefault(ConfigurationNode configurationNode) {
    try {
        if (valueTypeToken != null) {
            configurationNode.setValue(valueTypeToken, this.defaultValue);
        } else {
            configurationNode.setValue(this.defaultValue);
        }
    } catch (ObjectMappingException e) {
        e.printStackTrace();
    }
}
 
開發者ID:ichorpowered,項目名稱:elderguardian,代碼行數:12,代碼來源:StorageValue.java

示例10: getStringList

import ninja.leaping.configurate.objectmapping.ObjectMappingException; //導入方法依賴的package包/類
public List<String> getStringList(Object... key){		
	try {
		return config.getNode(key).getList(TypeToken.of(String.class));
	} catch (ObjectMappingException e) {
		e.printStackTrace();
	}
	return null;
}
 
開發者ID:FabioZumbi12,項目名稱:Sponge-RankUpper,代碼行數:9,代碼來源:RUConfig.java

示例11: PlayerFilter

import ninja.leaping.configurate.objectmapping.ObjectMappingException; //導入方法依賴的package包/類
public PlayerFilter(WebHook hook, ConfigurationNode config) {
    super(hook, config);

    try {
        players = config.getList(TypeToken.of(String.class));
    } catch (ObjectMappingException e) {
        e.printStackTrace();
    }
}
 
開發者ID:Valandur,項目名稱:Web-API,代碼行數:10,代碼來源:PlayerFilter.java

示例12: BlockTypeFilter

import ninja.leaping.configurate.objectmapping.ObjectMappingException; //導入方法依賴的package包/類
public BlockTypeFilter(WebHook hook, ConfigurationNode config) {
    super(hook, config);

    try {
        types = config.getList(TypeToken.of(BlockType.class));
    } catch (ObjectMappingException e) {
        e.printStackTrace();
    }
}
 
開發者ID:Valandur,項目名稱:Web-API,代碼行數:10,代碼來源:BlockTypeFilter.java

示例13: ItemTypeFilter

import ninja.leaping.configurate.objectmapping.ObjectMappingException; //導入方法依賴的package包/類
public ItemTypeFilter(WebHook hook, ConfigurationNode config) {
    super(hook, config);

    try {
        items = config.getList(TypeToken.of(ItemType.class));
    } catch (ObjectMappingException e) {
        e.printStackTrace();
    }
}
 
開發者ID:Valandur,項目名稱:Web-API,代碼行數:10,代碼來源:ItemTypeFilter.java

示例14: generateDefaults

import ninja.leaping.configurate.objectmapping.ObjectMappingException; //導入方法依賴的package包/類
/**
 * Generates the default {@link ConfigurationNode} to populate.
 *
 * @param node An empty node to be populated.
 * @return The populated node.
 */
@Override
@SuppressWarnings("unchecked")
protected ConfigurationNode generateDefaults(ConfigurationNode node) {
    R o = getDefaultObject();
    try {
        return node.setValue(TypeToken.of((Class<R>)o.getClass()), o);
    } catch (ObjectMappingException e) {
        e.printStackTrace();
        return node;
    }
}
 
開發者ID:NucleusPowered,項目名稱:QuickStartModuleLoader,代碼行數:18,代碼來源:TypedAbstractConfigAdapter.java

示例15: addItemKey

import ninja.leaping.configurate.objectmapping.ObjectMappingException; //導入方法依賴的package包/類
public void addItemKey(String key, List<String> cmds){		
	try {
		cmds.addAll(config.getNode("itemKeys",key,"cmds").getList(TypeToken.of(String.class), new ArrayList<String>()));
		config.getNode("itemKeys",key,"cmds").setValue(cmds);
	} catch (ObjectMappingException e) {
		e.printStackTrace();
	}
	saveConfigAll();
}
 
開發者ID:FabioZumbi12,項目名稱:PixelVip,代碼行數:10,代碼來源:PVConfig.java


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