本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}