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


Java XMLReader.readText方法代码示例

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


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

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

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

示例3: loadSelf

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

    if (TAG_REACH.equals(name)) {
        mReach = reader.readText();
    } else if (TAG_PARRY.equals(name)) {
        mParry = reader.readText();
    } else if (TAG_BLOCK.equals(name)) {
        mBlock = reader.readText();
    } else {
        super.loadSelf(reader);
    }
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:15,代码来源:MeleeWeaponStats.java

示例4: loadTag

import com.trollworks.toolkit.io.xml.XMLReader; //导入方法依赖的package包/类
boolean loadTag(XMLReader reader, String tag) throws IOException {
    if (TAG_PLAYER_NAME.equals(tag)) {
        mPlayerName = reader.readText();
    } else if (TAG_CAMPAIGN.equals(tag)) {
        mCampaign = reader.readText();
    } else if (TAG_NAME.equals(tag)) {
        mName = reader.readText();
    } else if (TAG_OLD_NOTES.equals(tag)) {
        Note note = new Note(mCharacter, false);
        note.setDescription(Text.standardizeLineEndings(reader.readText()));
        mCharacter.getNotesRoot().addRow(note, false);
    } else if (TAG_TITLE.equals(tag)) {
        mTitle = reader.readText();
    } else if (TAG_AGE.equals(tag)) {
        mAge = reader.readInteger(0);
    } else if (TAG_BIRTHDAY.equals(tag)) {
        mBirthday = reader.readText();
    } else if (TAG_EYES.equals(tag)) {
        mEyeColor = reader.readText();
    } else if (TAG_HAIR.equals(tag)) {
        mHair = reader.readText();
    } else if (TAG_SKIN.equals(tag)) {
        mSkinColor = reader.readText();
    } else if (TAG_HANDEDNESS.equals(tag)) {
        mHandedness = reader.readText();
    } else if (TAG_HEIGHT.equals(tag)) {
        mHeight = LengthValue.extract(reader.readText(), false);
    } else if (TAG_WEIGHT.equals(tag)) {
        mWeight = WeightValue.extract(reader.readText(), false);
    } else if (BonusAttributeType.SM.getXMLTag().equals(tag) || "size_modifier".equals(tag)) { //$NON-NLS-1$
        mSizeModifier = reader.readInteger(0);
    } else if (TAG_GENDER.equals(tag)) {
        mGender = reader.readText();
    } else if (TAG_RACE.equals(tag)) {
        mRace = reader.readText();
    } else if (TAG_BODY_TYPE.equals(tag)) {
        mHitLocationTable = HitLocationTable.MAP.get(reader.readText());
        if (mHitLocationTable == null) {
            mHitLocationTable = HitLocationTable.HUMANOID;
        }
    } else if (TAG_TECH_LEVEL.equals(tag)) {
        mTechLevel = reader.readText();
    } else if (TAG_RELIGION.equals(tag)) {
        mReligion = reader.readText();
    } else if (TAG_PORTRAIT.equals(tag)) {
        try {
            mPortrait = createPortrait(StdImage.loadImage(Base64.getMimeDecoder().decode(reader.readText())));
            mCustomPortrait = true;
        } catch (Exception imageException) {
            // Ignore
        }
    } else {
        return false;
    }
    return true;
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:57,代码来源:Profile.java

示例5: loadSelf

import com.trollworks.toolkit.io.xml.XMLReader; //导入方法依赖的package包/类
@Override
protected final void loadSelf(XMLReader reader, LoadState state) throws IOException {
    String marker = reader.getMarker();
    int unspentPoints = 0;

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

            if (state.mDataFileVersion == 0) {
                if (mDescription.loadTag(reader, name)) {
                    continue;
                }
            }

            if (Profile.TAG_ROOT.equals(name)) {
                mDescription.load(reader);
            } else if (TAG_CREATED_DATE.equals(name)) {
                mCreatedOn = Numbers.extractDate(reader.readText());
            } else if (TAG_MODIFIED_DATE.equals(name)) {
                mLastModified = Numbers.extractDateTime(reader.readText());
            } else if (BonusAttributeType.HP.getXMLTag().equals(name)) {
                mHitPoints = reader.readInteger(0);
            } else if (TAG_CURRENT_HP.equals(name)) {
                mCurrentHitPoints = reader.readText();
            } else if (BonusAttributeType.FP.getXMLTag().equals(name)) {
                mFatiguePoints = reader.readInteger(0);
            } else if (TAG_CURRENT_FP.equals(name)) {
                mCurrentFatiguePoints = reader.readText();
            } else if (TAG_UNSPENT_POINTS.equals(name)) {
                unspentPoints = reader.readInteger(0);
            } else if (TAG_TOTAL_POINTS.equals(name)) {
                mTotalPoints = reader.readInteger(0);
            } else if (BonusAttributeType.ST.getXMLTag().equals(name)) {
                mStrength = reader.readInteger(0);
            } else if (BonusAttributeType.DX.getXMLTag().equals(name)) {
                mDexterity = reader.readInteger(0);
            } else if (BonusAttributeType.IQ.getXMLTag().equals(name)) {
                mIntelligence = reader.readInteger(0);
            } else if (BonusAttributeType.HT.getXMLTag().equals(name)) {
                mHealth = reader.readInteger(0);
            } else if (BonusAttributeType.WILL.getXMLTag().equals(name)) {
                mWill = reader.readInteger(0);
            } else if (BonusAttributeType.PERCEPTION.getXMLTag().equals(name)) {
                mPerception = reader.readInteger(0);
            } else if (BonusAttributeType.SPEED.getXMLTag().equals(name)) {
                mSpeed = reader.readDouble(0.0);
            } else if (BonusAttributeType.MOVE.getXMLTag().equals(name)) {
                mMove = reader.readInteger(0);
            } else if (TAG_INCLUDE_PUNCH.equals(name)) {
                mIncludePunch = reader.readBoolean();
            } else if (TAG_INCLUDE_KICK.equals(name)) {
                mIncludeKick = reader.readBoolean();
            } else if (TAG_INCLUDE_BOOTS.equals(name)) {
                mIncludeKickBoots = reader.readBoolean();
            } else 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)) {
                loadNoteList(reader, state);
            } else if (PrintManager.TAG_ROOT.equals(name)) {
                if (mPageSettings != null) {
                    mPageSettings.load(reader);
                }
            } else {
                reader.skipTag(name);
            }
        }
    } while (reader.withinMarker(marker));

    calculateAll();
    if (unspentPoints != 0) {
        setUnspentPoints(unspentPoints);
    }
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:82,代码来源:GURPSCharacter.java

示例6: 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(NEWLINE, SPACE);
        // Fix for legacy format...
        if (mName.toLowerCase().endsWith("(vh)")) { //$NON-NLS-1$
            mName = mName.substring(0, mName.length() - 4).trim();
            mIsVeryHard = true;
        }
    } else if (TAG_TECH_LEVEL.equals(name)) {
        mTechLevel = reader.readText();
        if (mTechLevel != null) {
            DataFile dataFile = getDataFile();
            if (dataFile instanceof ListFile || dataFile instanceof LibraryFile) {
                mTechLevel = EMPTY;
            }
        }
    } else if (TAG_REFERENCE.equals(name)) {
        mReference = reader.readText().replace(NEWLINE, SPACE);
    } else if (!state.mForUndo && (TAG_SPELL.equals(name) || TAG_SPELL_CONTAINER.equals(name))) {
        addChild(new Spell(mDataFile, reader, state));
    } else if (!canHaveChildren()) {
        if (TAG_COLLEGE.equals(name)) {
            mCollege = reader.readText().replace(NEWLINE, SPACE).replace("/ ", "/"); //$NON-NLS-1$ //$NON-NLS-2$
        } else if (TAG_POWER_SOURCE.equals(name)) {
            mPowerSource = reader.readText().replace(NEWLINE, SPACE);
        } else if (TAG_SPELL_CLASS.equals(name)) {
            mSpellClass = reader.readText().replace(NEWLINE, SPACE);
        } else if (TAG_CASTING_COST.equals(name)) {
            mCastingCost = reader.readText().replace(NEWLINE, SPACE);
        } else if (TAG_MAINTENANCE_COST.equals(name)) {
            mMaintenance = reader.readText().replace(NEWLINE, SPACE);
        } else if (TAG_CASTING_TIME.equals(name)) {
            mCastingTime = reader.readText().replace(NEWLINE, SPACE);
        } else if (TAG_DURATION.equals(name)) {
            mDuration = reader.readText().replace(NEWLINE, SPACE);
        } else if (TAG_POINTS.equals(name)) {
            mPoints = reader.readInteger(1);
        } 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 {
            super.loadSubElement(reader, state);
        }
    } else {
        super.loadSubElement(reader, state);
    }
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:51,代码来源:Spell.java

示例7: load

import com.trollworks.toolkit.io.xml.XMLReader; //导入方法依赖的package包/类
/**
 * Loads this row's contents.
 *
 * @param reader The XML reader to load from.
 * @param state The {@link LoadState} to use.
 */
public final void load(XMLReader reader, LoadState state) throws IOException {
    String marker = reader.getMarker();
    state.mDataItemVersion = reader.getAttributeAsInteger(LoadState.ATTRIBUTE_VERSION, 0);
    if (state.mDataItemVersion > getXMLTagVersion()) {
        throw VersionException.createTooNew();
    }
    prepareForLoad(state);
    loadAttributes(reader, state);
    do {
        if (reader.next() == XMLNodeType.START_TAG) {
            String name = reader.getName();
            if (AttributeBonus.TAG_ROOT.equals(name)) {
                mFeatures.add(new AttributeBonus(reader));
            } else if (DRBonus.TAG_ROOT.equals(name)) {
                mFeatures.add(new DRBonus(reader));
            } else if (SkillBonus.TAG_ROOT.equals(name)) {
                mFeatures.add(new SkillBonus(reader));
            } else if (SpellBonus.TAG_ROOT.equals(name)) {
                mFeatures.add(new SpellBonus(reader));
            } else if (WeaponBonus.TAG_ROOT.equals(name)) {
                mFeatures.add(new WeaponBonus(reader));
            } else if (CostReduction.TAG_ROOT.equals(name)) {
                mFeatures.add(new CostReduction(reader));
            } else if (ContainedWeightReduction.TAG_ROOT.equals(name)) {
                mFeatures.add(new ContainedWeightReduction(reader));
            } else if (PrereqList.TAG_ROOT.equals(name)) {
                mPrereqList = new PrereqList(null, reader);
            } else if (!(this instanceof Technique) && SkillDefault.TAG_ROOT.equals(name)) {
                mDefaults.add(new SkillDefault(reader));
            } else if (TAG_NOTES.equals(name)) {
                mNotes = reader.readText();
            } else if (TAG_CATEGORIES.equals(name)) {
                String subMarker = reader.getMarker();
                do {
                    if (reader.next() == XMLNodeType.START_TAG) {
                        name = reader.getName();
                        if (TAG_CATEGORY.equals(name)) {
                            mCategories.add(reader.readText());
                        } else {
                            reader.skipTag(name);
                        }
                    }
                } while (reader.withinMarker(subMarker));
            } else {
                loadSubElement(reader, state);
            }
        }
    } while (reader.withinMarker(marker));
    finishedLoading(state);
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:57,代码来源:ListRow.java

示例8: 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_CR.equals(name)) {
        mCRAdj = Enums.extract(reader.getAttribute(SelfControlRoll.ATTR_ADJUSTMENT), SelfControlRollAdjustments.values(), SelfControlRollAdjustments.NONE);
        mCR = SelfControlRoll.get(reader.readText());
    } else if (TAG_REFERENCE.equals(name)) {
        mReference = reader.readText().replace("\n", " "); //$NON-NLS-1$ //$NON-NLS-2$
    } else if (!state.mForUndo && (TAG_ADVANTAGE.equals(name) || TAG_ADVANTAGE_CONTAINER.equals(name))) {
        addChild(new Advantage(mDataFile, reader, state));
    } else if (Modifier.TAG_MODIFIER.equals(name)) {
        mModifiers.add(new Modifier(getDataFile(), reader, state));
    } else if (!canHaveChildren()) {
        if (TAG_TYPE.equals(name)) {
            mType = getTypeFromText(reader.readText());
        } else if (TAG_LEVELS.equals(name)) {
            // Read the attribute first as next operation clears attribute map
            mHalfLevel = mAllowHalfLevels && reader.isAttributeSet(ATTR_HALF_LEVEL);
            mLevels = reader.readInteger(-1);
        } else if (TAG_OLD_POINTS.equals(name)) {
            mOldPointsString = reader.readText();
        } else if (TAG_BASE_POINTS.equals(name)) {
            mPoints = reader.readInteger(0);
        } else if (TAG_POINTS_PER_LEVEL.equals(name)) {
            mPointsPerLevel = reader.readInteger(0);
        } 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 {
            super.loadSubElement(reader, state);
        }
    } else {
        super.loadSubElement(reader, state);
    }
}
 
开发者ID:richardwilkes,项目名称:gcs,代码行数:42,代码来源:Advantage.java


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