本文整理匯總了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);
}
}
}
}
示例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;
}
}
}
示例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();
}
}
示例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!");
}
}
示例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;
}
示例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!");
}
}
示例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();
}
示例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();
}
}
示例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();
}
}
示例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;
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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;
}
}
示例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();
}