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


Java XMLReader.getName方法代码示例

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


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

示例1: load

import com.trollworks.toolkit.io.xml.XMLReader; //导入方法依赖的package包/类
/**
 * Loads a cost reduction.
 * 
 * @param reader The XML reader to use.
 */
protected void load(XMLReader reader) throws IOException {
    String marker = reader.getMarker();

    do {
        if (reader.next() == XMLNodeType.START_TAG) {
            String name = reader.getName();

            if (TAG_ATTRIBUTE.equals(name)) {
                setAttribute(Enums.extract(reader.readText(), TYPES, BonusAttributeType.ST));
            } else if (TAG_PERCENTAGE.equals(name)) {
                setPercentage(reader.readInteger(0));
            } else {
                reader.skipTag(name);
            }
        }
    } while (reader.withinMarker(marker));
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:23,代码来源:CostReduction.java

示例2: loadSubElement

import com.trollworks.toolkit.io.xml.XMLReader; //导入方法依赖的package包/类
@Override
protected void loadSubElement(XMLReader reader, LoadState state) throws IOException {
    String name = reader.getName();
    if (TAG_NAME.equals(name)) {
        mName = reader.readText().replace("\n", " "); //$NON-NLS-1$ //$NON-NLS-2$
    } else if (TAG_REFERENCE.equals(name)) {
        mReference = reader.readText().replace("\n", " "); //$NON-NLS-1$ //$NON-NLS-2$
    } else if (TAG_COST.equals(name)) {
        mCostType = Enums.extract(reader.getAttribute(ATTRIBUTE_COST_TYPE), CostType.values(), CostType.PERCENTAGE);
        if (mCostType == CostType.MULTIPLIER) {
            mCostMultiplier = reader.readDouble(1.0);
        } else {
            mCost = reader.readInteger(0);
        }
    } else if (TAG_LEVELS.equals(name)) {
        mLevels = reader.readInteger(0);
    } else if (TAG_AFFECTS.equals(name)) {
        mAffects = Enums.extract(reader.readText(), Affects.values(), Affects.TOTAL);
    } else {
        super.loadSubElement(reader, state);
    }
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:23,代码来源:Modifier.java

示例3: loadList

import com.trollworks.toolkit.io.xml.XMLReader; //导入方法依赖的package包/类
@Override
protected void loadList(XMLReader reader, LoadState state) throws IOException {
    OutlineModel model = getModel();
    String marker = reader.getMarker();
    do {
        if (reader.next() == XMLNodeType.START_TAG) {
            String name = reader.getName();

            if (Advantage.TAG_ADVANTAGE.equals(name) || Advantage.TAG_ADVANTAGE_CONTAINER.equals(name)) {
                model.addRow(new Advantage(this, reader, state), true);
            } else {
                reader.skipTag(name);
            }
        }
    } while (reader.withinMarker(marker));
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:17,代码来源:AdvantageList.java

示例4: loadSelf

import com.trollworks.toolkit.io.xml.XMLReader; //导入方法依赖的package包/类
@Override
protected void loadSelf(XMLReader reader, LoadState state) throws IOException {
    setup();
    String name = reader.getName();
    if (TAG_ROOT.equals(name)) {
        String marker = reader.getMarker();
        do {
            if (reader.next() == XMLNodeType.START_TAG) {
                name = reader.getName();
                if (AdvantageList.TAG_ROOT.equals(name)) {
                    mAdvantages.load(reader, state);
                } else if (SkillList.TAG_ROOT.equals(name)) {
                    mSkills.load(reader, state);
                } else if (SpellList.TAG_ROOT.equals(name)) {
                    mSpells.load(reader, state);
                } else if (EquipmentList.TAG_ROOT.equals(name)) {
                    mEquipment.load(reader, state);
                } else {
                    reader.skipTag(name);
                }
            }
        } while (reader.withinMarker(marker));
    }
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:25,代码来源:LibraryFile.java

示例5: loadList

import com.trollworks.toolkit.io.xml.XMLReader; //导入方法依赖的package包/类
@Override
protected void loadList(XMLReader reader, LoadState state) throws IOException {
    OutlineModel model = getModel();
    String marker = reader.getMarker();
    do {
        if (reader.next() == XMLNodeType.START_TAG) {
            String name = reader.getName();

            if (Skill.TAG_SKILL.equals(name) || Skill.TAG_SKILL_CONTAINER.equals(name)) {
                model.addRow(new Skill(this, reader, state), true);
            } else if (Technique.TAG_TECHNIQUE.equals(name)) {
                model.addRow(new Technique(this, reader, state), true);
            } else {
                reader.skipTag(name);
            }
        }
    } while (reader.withinMarker(marker));
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:19,代码来源:SkillList.java

示例6: loadSelf

import com.trollworks.toolkit.io.xml.XMLReader; //导入方法依赖的package包/类
/** @param reader The reader to load from. */
protected void loadSelf(XMLReader reader) throws IOException {
    String name = reader.getName();

    if (TAG_DAMAGE.equals(name)) {
        mDamage = reader.readText();
    } else if (TAG_STRENGTH.equals(name)) {
        mStrength = reader.readText();
    } else if (TAG_USAGE.equals(name)) {
        mUsage = reader.readText();
    } else if (SkillDefault.TAG_ROOT.equals(name)) {
        mDefaults.add(new SkillDefault(reader));
    } else {
        reader.skipTag(name);
    }
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:17,代码来源:WeaponStats.java

示例7: loadSelf

import com.trollworks.toolkit.io.xml.XMLReader; //导入方法依赖的package包/类
/** @param reader The XML reader to use. */
protected void loadSelf(XMLReader reader) throws IOException {
    String tag = reader.getName();

    if (TAG_AMOUNT.equals(tag)) {
        mAmount.load(reader);
    } else {
        reader.skipTag(tag);
    }
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:11,代码来源:Bonus.java

示例8: loadSelf

import com.trollworks.toolkit.io.xml.XMLReader; //导入方法依赖的package包/类
/** @param reader The XML reader to load from. */
protected void loadSelf(XMLReader reader) throws IOException {
    String name = reader.getName();

    if (TAG_NAME.equals(name)) {
        mNameCriteria.load(reader);
    } else if (TAG_LEVEL.equals(name)) {
        mLevelCriteria.load(reader);
    } else {
        reader.skipTag(name);
    }
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:13,代码来源:NameLevelPrereq.java

示例9: loadAdvantageList

import com.trollworks.toolkit.io.xml.XMLReader; //导入方法依赖的package包/类
private void loadAdvantageList(XMLReader reader, LoadState state) throws IOException {
    String marker = reader.getMarker();
    do {
        if (reader.next() == XMLNodeType.START_TAG) {
            String name = reader.getName();
            if (Advantage.TAG_ADVANTAGE.equals(name) || Advantage.TAG_ADVANTAGE_CONTAINER.equals(name)) {
                mAdvantages.addRow(new Advantage(this, reader, state), true);
            } else {
                reader.skipTag(name);
            }
        }
    } while (reader.withinMarker(marker));
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:14,代码来源:Template.java

示例10: loadSubElement

import com.trollworks.toolkit.io.xml.XMLReader; //导入方法依赖的package包/类
@Override
protected void loadSubElement(XMLReader reader, LoadState state) throws IOException {
    String name = reader.getName();
    if (TAG_DESCRIPTION.equals(name)) {
        mDescription = reader.readText().replace(NEWLINE, SPACE);
    } else if (TAG_TECH_LEVEL.equals(name)) {
        mTechLevel = reader.readText().replace(NEWLINE, SPACE);
    } else if (TAG_LEGALITY_CLASS.equals(name)) {
        mLegalityClass = reader.readText().replace(NEWLINE, SPACE);
    } else if (TAG_VALUE.equals(name)) {
        mValue = reader.readDouble(0.0);
    } else if (TAG_WEIGHT.equals(name)) {
        mWeight = WeightValue.extract(reader.readText(), false);
    } else if (TAG_REFERENCE.equals(name)) {
        mReference = reader.readText().replace(NEWLINE, SPACE);
    } else if (!state.mForUndo && (TAG_EQUIPMENT.equals(name) || TAG_EQUIPMENT_CONTAINER.equals(name))) {
        addChild(new Equipment(mDataFile, reader, state));
    } else if (MeleeWeaponStats.TAG_ROOT.equals(name)) {
        mWeapons.add(new MeleeWeaponStats(this, reader));
    } else if (RangedWeaponStats.TAG_ROOT.equals(name)) {
        mWeapons.add(new RangedWeaponStats(this, reader));
    } else if (OldWeapon.TAG_ROOT.equals(name)) {
        state.mOldWeapons.put(this, new OldWeapon(reader));
    } else if (!canHaveChildren()) {
        if (TAG_QUANTITY.equals(name)) {
            mQuantity = reader.readInteger(1);
        } else {
            super.loadSubElement(reader, state);
        }
    } else {
        super.loadSubElement(reader, state);
    }
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:34,代码来源:Equipment.java

示例11: loadSpellList

import com.trollworks.toolkit.io.xml.XMLReader; //导入方法依赖的package包/类
private void loadSpellList(XMLReader reader, LoadState state) throws IOException {
    String marker = reader.getMarker();
    do {
        if (reader.next() == XMLNodeType.START_TAG) {
            String name = reader.getName();
            if (Spell.TAG_SPELL.equals(name) || Spell.TAG_SPELL_CONTAINER.equals(name)) {
                mSpells.addRow(new Spell(this, reader, state), true);
            } else {
                reader.skipTag(name);
            }
        }
    } while (reader.withinMarker(marker));
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:14,代码来源:Template.java

示例12: loadSkillList

import com.trollworks.toolkit.io.xml.XMLReader; //导入方法依赖的package包/类
private void loadSkillList(XMLReader reader, LoadState state) throws IOException {
    String marker = reader.getMarker();
    do {
        if (reader.next() == XMLNodeType.START_TAG) {
            String name = reader.getName();
            if (Skill.TAG_SKILL.equals(name) || Skill.TAG_SKILL_CONTAINER.equals(name)) {
                mSkills.addRow(new Skill(this, reader, state), true);
            } else if (Technique.TAG_TECHNIQUE.equals(name)) {
                mSkills.addRow(new Technique(this, reader, state), true);
            } else {
                reader.skipTag(name);
            }
        }
    } while (reader.withinMarker(marker));
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:16,代码来源:GURPSCharacter.java

示例13: loadEquipmentList

import com.trollworks.toolkit.io.xml.XMLReader; //导入方法依赖的package包/类
private void loadEquipmentList(XMLReader reader, LoadState state) throws IOException {
    String marker = reader.getMarker();
    state.mDefaultCarried = state.mDataFileVersion != 0 ? true : reader.isAttributeSet(ATTRIBUTE_CARRIED);
    do {
        if (reader.next() == XMLNodeType.START_TAG) {
            String name = reader.getName();
            if (Equipment.TAG_EQUIPMENT.equals(name) || Equipment.TAG_EQUIPMENT_CONTAINER.equals(name)) {
                mEquipment.addRow(new Equipment(this, reader, state), true);
            } else {
                reader.skipTag(name);
            }
        }
    } while (reader.withinMarker(marker));
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:15,代码来源:GURPSCharacter.java

示例14: loadSelf

import com.trollworks.toolkit.io.xml.XMLReader; //导入方法依赖的package包/类
@Override
protected final void loadSelf(XMLReader reader, LoadState state) throws IOException {
    String marker = reader.getMarker();
    do {
        if (reader.next() == XMLNodeType.START_TAG) {
            String name = reader.getName();
            if (AdvantageList.TAG_ROOT.equals(name)) {
                loadAdvantageList(reader, state);
            } else if (SkillList.TAG_ROOT.equals(name)) {
                loadSkillList(reader, state);
            } else if (SpellList.TAG_ROOT.equals(name)) {
                loadSpellList(reader, state);
            } else if (EquipmentList.TAG_ROOT.equals(name)) {
                loadEquipmentList(reader, state);
            } else if (NoteList.TAG_ROOT.equals(name)) {
                loadNotesList(reader, state);
            } else if (TAG_OLD_NOTES.equals(name)) {
                Note note = new Note(this, false);
                note.setDescription(Text.standardizeLineEndings(reader.readText()));
                mNotes.addRow(note, false);
            } else {
                reader.skipTag(name);
            }
        }
    } while (reader.withinMarker(marker));
    calculateAdvantagePoints();
    calculateSkillPoints();
    calculateSpellPoints();
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:30,代码来源:Template.java

示例15: PrereqList

import com.trollworks.toolkit.io.xml.XMLReader; //导入方法依赖的package包/类
/**
 * Loads a prerequisite list.
 *
 * @param parent The owning prerequisite list, if any.
 * @param reader The XML reader to load from.
 */
public PrereqList(PrereqList parent, XMLReader reader) throws IOException {
    this(parent, true);
    String marker = reader.getMarker();
    mAll = reader.isAttributeSet(ATTRIBUTE_ALL);
    do {
        if (reader.next() == XMLNodeType.START_TAG) {
            String name = reader.getName();
            if (TAG_WHEN_TL.equals(name)) {
                mWhenTLCriteria.load(reader);
            } else if (TAG_ROOT.equals(name)) {
                mPrereqs.add(new PrereqList(this, reader));
            } else if (AdvantagePrereq.TAG_ROOT.equals(name)) {
                mPrereqs.add(new AdvantagePrereq(this, reader));
            } else if (AttributePrereq.TAG_ROOT.equals(name)) {
                mPrereqs.add(new AttributePrereq(this, reader));
            } else if (ContainedWeightPrereq.TAG_ROOT.equals(name)) {
                mPrereqs.add(new ContainedWeightPrereq(this, reader));
            } else if (SkillPrereq.TAG_ROOT.equals(name)) {
                mPrereqs.add(new SkillPrereq(this, reader));
            } else if (SpellPrereq.TAG_ROOT.equals(name)) {
                mPrereqs.add(new SpellPrereq(this, reader));
            } else {
                reader.skipTag(name);
            }
        }
    } while (reader.withinMarker(marker));
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:34,代码来源:PrereqList.java


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