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


Java XMLReader类代码示例

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


XMLReader类属于com.trollworks.toolkit.io.xml包,在下文中一共展示了XMLReader类的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: loadSelf

import com.trollworks.toolkit.io.xml.XMLReader; //导入依赖的package包/类
@Override
protected void loadSelf(XMLReader reader) throws IOException {
    String name = reader.getName();
    if (TAG_COLLEGE_NAME.equals(name)) {
        mMatchType = TAG_COLLEGE_NAME;
        mNameCriteria.load(reader);
    } else if (TAG_POWER_SOURCE_NAME.equals(name)) {
        mMatchType = TAG_POWER_SOURCE_NAME;
        mNameCriteria.load(reader);
    } else if (TAG_SPELL_NAME.equals(name)) {
        mMatchType = TAG_SPELL_NAME;
        mNameCriteria.load(reader);
    } else {
        super.loadSelf(reader);
    }
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:17,代码来源:SpellBonus.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 (Modifier.TAG_MODIFIER.equals(name)) {
                model.addRow(new Modifier(this, reader, state), true);
            } else {
                reader.skipTag(name);
            }
        }
    } while (reader.withinMarker(marker));
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:17,代码来源:ModifierList.java

示例4: 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

示例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: deserialize

import com.trollworks.toolkit.io.xml.XMLReader; //导入依赖的package包/类
private void deserialize(byte[] buffer) {
    try (XMLReader reader = new XMLReader(new InputStreamReader(new GZIPInputStream(new ByteArrayInputStream(buffer))))) {
        XMLNodeType type = reader.next();
        LoadState state = new LoadState();
        state.mForUndo = true;
        while (type != XMLNodeType.END_DOCUMENT) {
            if (type == XMLNodeType.START_TAG) {
                mRow.load(reader, state);
                type = reader.getType();
            } else {
                type = reader.next();
            }
        }
    } catch (Exception exception) {
        exception.printStackTrace(System.err);
    }
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:18,代码来源:RowUndo.java

示例7: 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

示例8: 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

示例9: loadSelf

import com.trollworks.toolkit.io.xml.XMLReader; //导入依赖的package包/类
@Override
protected void loadSelf(XMLReader reader) throws IOException {
    String name = reader.getName();

    if (TAG_ACCURACY.equals(name)) {
        mAccuracy = reader.readText();
    } else if (TAG_RANGE.equals(name)) {
        mRange = reader.readText();
    } else if (TAG_RATE_OF_FIRE.equals(name)) {
        mRateOfFire = reader.readText();
    } else if (TAG_SHOTS.equals(name)) {
        mShots = reader.readText();
    } else if (TAG_BULK.equals(name)) {
        mBulk = reader.readText();
    } else if (TAG_RECOIL.equals(name)) {
        mRecoil = reader.readText();
    } else {
        super.loadSelf(reader);
    }
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:21,代码来源:RangedWeaponStats.java

示例10: 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

示例11: loadSelf

import com.trollworks.toolkit.io.xml.XMLReader; //导入依赖的package包/类
@Override
protected void loadSelf(XMLReader reader) throws IOException {
    if (TAG_NAME.equals(reader.getName())) {
        mNameCriteria.load(reader);
    } else if (TAG_SPECIALIZATION.equals(reader.getName())) {
        mSpecializationCriteria.load(reader);
    } else if (TAG_LEVEL.equals(reader.getName())) {
        mLevelCriteria.load(reader);
    } else {
        super.loadSelf(reader);
    }
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:13,代码来源:WeaponBonus.java

示例12: load

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

    do {
        if (reader.next() == XMLNodeType.START_TAG) {
            loadSelf(reader);
        }
    } while (reader.withinMarker(marker));
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:11,代码来源:Bonus.java

示例13: 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

示例14: loadSelf

import com.trollworks.toolkit.io.xml.XMLReader; //导入依赖的package包/类
@Override
protected void loadSelf(XMLReader reader) throws IOException {
    if (TAG_LOCATION.equals(reader.getName())) {
        setLocation(Enums.extract(reader.readText(), HitLocation.values(), HitLocation.TORSO));
    } else {
        super.loadSelf(reader);
    }
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:9,代码来源:DRBonus.java

示例15: loadSelf

import com.trollworks.toolkit.io.xml.XMLReader; //导入依赖的package包/类
@Override
protected void loadSelf(XMLReader reader) throws IOException {
    String name = reader.getName();
    if (TAG_NAME.equals(name)) {
        mNameCriteria.load(reader);
    } else if (TAG_SPECIALIZATION.equals(name)) {
        mSpecializationCriteria.load(reader);
    } else {
        super.loadSelf(reader);
    }
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:12,代码来源:SkillBonus.java


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