当前位置: 首页>>代码示例>>Java>>正文


Java Attribute.getIntValue方法代码示例

本文整理汇总了Java中org.jdom2.Attribute.getIntValue方法的典型用法代码示例。如果您正苦于以下问题:Java Attribute.getIntValue方法的具体用法?Java Attribute.getIntValue怎么用?Java Attribute.getIntValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jdom2.Attribute的用法示例。


在下文中一共展示了Attribute.getIntValue方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: parseEnchantmentStorage

import org.jdom2.Attribute; //导入方法依赖的package包/类
public static EnchantmentStorageMeta parseEnchantmentStorage(Element xml, EnchantmentStorageMeta source) {
    Element book = xml.getChild("enchanted-book");
    if (book != null) {
        for (Element enchantment : book.getChildren("enchantment")) {
            Enchantment type = Enchantment.getByName(XMLParser.parseEnumValue(enchantment.getTextNormalize()));
            int level = 1;

            try {
                Attribute levelAttribute = enchantment.getAttribute("level");
                if (levelAttribute != null) {
                    level = levelAttribute.getIntValue();
                }
            } catch (DataConversionException ignored) {
            }

            source.addStoredEnchant(type, level, false);
        }
    }

    return source;
}
 
开发者ID:ShootGame,项目名称:Arcade2,代码行数:22,代码来源:XMLItemMeta.java

示例2: parseEnchantments

import org.jdom2.Attribute; //导入方法依赖的package包/类
private static Map<Enchantment, Integer> parseEnchantments(Element xml) {
    Map<Enchantment, Integer> enchantments = new HashMap<>();

    Element element = xml.getChild("enchantments");
    if (element != null) {
        for (Element enchantment : element.getChildren("enchantment")) {
            Enchantment type = Enchantment.getByName(XMLParser.parseEnumValue(enchantment.getTextNormalize()));
            int level = 1;

            try {
                Attribute levelAttribute = enchantment.getAttribute("level");
                if (levelAttribute != null) {
                    level = levelAttribute.getIntValue();
                }
            } catch (DataConversionException ignored) {
            }

            enchantments.put(type, level);
        }
    }

    return enchantments;
}
 
开发者ID:ShootGame,项目名称:Arcade2,代码行数:24,代码来源:XMLItemStack.java

示例3: parseMaxPlayers

import org.jdom2.Attribute; //导入方法依赖的package包/类
public static int parseMaxPlayers(Element xml) {
    Attribute attribute = xml.getAttribute("overfill");
    if (attribute != null) {
        try {
            return attribute.getIntValue();
        } catch (DataConversionException ignored) {
        }
    }

    return 0;
}
 
开发者ID:ShootGame,项目名称:Arcade2,代码行数:12,代码来源:XMLTeam.java

示例4: parseMinPlayers

import org.jdom2.Attribute; //导入方法依赖的package包/类
public static int parseMinPlayers(Element xml) {
    Attribute attribute = xml.getAttribute("min-players");
    if (attribute != null) {
        try {
            return attribute.getIntValue();
        } catch (DataConversionException ignored) {
        }
    }

    return 0;
}
 
开发者ID:ShootGame,项目名称:Arcade2,代码行数:12,代码来源:XMLTeam.java

示例5: parseSlots

import org.jdom2.Attribute; //导入方法依赖的package包/类
public static int parseSlots(Element xml) {
    Attribute attribute = xml.getAttribute("slots");
    if (attribute != null) {
        try {
            return attribute.getIntValue();
        } catch (DataConversionException ignored) {
        }
    }

    return 0;
}
 
开发者ID:ShootGame,项目名称:Arcade2,代码行数:12,代码来源:XMLTeam.java

示例6: parseAmount

import org.jdom2.Attribute; //导入方法依赖的package包/类
private static int parseAmount(Element xml) {
    Attribute attribute = xml.getAttribute("amount");
    if (attribute != null) {
        try {
            return attribute.getIntValue();
        } catch (DataConversionException ignored) {
        }
    }

    return 1;
}
 
开发者ID:ShootGame,项目名称:Arcade2,代码行数:12,代码来源:XMLItemStack.java

示例7: parseSlot

import org.jdom2.Attribute; //导入方法依赖的package包/类
private int parseSlot(Element xml) {
    Attribute attribute = xml.getAttribute("slot");
    if (attribute != null) {
        try {
            return attribute.getIntValue();
        } catch (DataConversionException ignored) {
        }
    }

    return SLOT_NULL;
}
 
开发者ID:ShootGame,项目名称:Arcade2,代码行数:12,代码来源:ItemStackContent.java

示例8: parseAmplifier

import org.jdom2.Attribute; //导入方法依赖的package包/类
private static int parseAmplifier(Element xml) {
    Attribute attribute = xml.getAttribute("amplifier");
    if (attribute != null) {
        try {
            return attribute.getIntValue();
        } catch (DataConversionException ignored) {
        }
    }

    return 1;
}
 
开发者ID:ShootGame,项目名称:Arcade2,代码行数:12,代码来源:XMLPotionEffect.java


注:本文中的org.jdom2.Attribute.getIntValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。