Package javax.xml.stream

Examples of javax.xml.stream.Location


   
    public boolean equals(Object o) {
        if (!(o instanceof Location)) {
            return false;
        }
        Location other = (Location) o;
        // char offset should be good enough, without row/col:
        if (other.getCharacterOffset() != getCharacterOffset()) {
            return false;
        }
        String otherPub = other.getPublicId();
        if (otherPub == null) {
            otherPub = "";
        }
        if (!otherPub.equals(mPublicId)) {
            return false;
        }
        String otherSys = other.getSystemId();
        if (otherSys == null) {
            otherSys = "";
        }
        return otherSys.equals(mSystemId);
    }
View Full Code Here


        // The pure stax way:
        assertEquals("&", sr.getText());

        // Finally, let's see that location info is about right?
        Location loc = sr.getCurrentLocation();
        assertNotNull(loc);
        assertEquals(16, loc.getCharacterOffset());
    }
View Full Code Here

            hash = (hash * 31) + (int) c;
        }

        // Ok, let's check and update id ref list...
        ElementIdMap m = v.getIdMap();
        Location loc = v.getLocation();
        ElementId id = m.addReferenced(cbuf, start, (end - start + 1), hash,
                                       loc, v.getElemName(), mName);
        // and that's all; no more checks needed here
        return normalize ? id.getId() : null;
    }
View Full Code Here

        /* Ok, event needs to know its exact starting point (opening '<'
         * char), let's get that info now (note: data has been preserved
         * earlier)
         */
        Location loc = getStartLocation();

        // Ok, where's our element?
        HashMap<PrefixedName,DTDElement> m = getElementMap();
        DTDElement elem = m.get(elemName);

View Full Code Here

        /* Ok, event needs to know its exact starting point (opening '<'
         * char), let's get that info now (note: data has been preserved
         * earlier)
         */
        Location loc = getStartLocation();

        // Ok; name got, need some white space next
        c = skipObligatoryDtdWs();

        /* Then the content spec: either a special case (ANY, EMPTY), or
View Full Code Here

        /* Ok, event needs to know its exact starting point (opening '<'
         * char), let's get that info now (note: data has been preserved
         * earlier)
         */
        Location evtLoc = getStartLocation();
        EntityDecl ent;

        try {
            c = skipObligatoryDtdWs();
            if (c == '\'' || c == '"') { // internal entity
                /* Let's get the exact location of actual content, not the
                 * opening quote. To do that, need to 'peek' next char, then
                 * push it back:
                 */
                /*char foo =*/ dtdNextFromCurr();
                Location contentLoc = getLastCharLocation();
                --mInputPtr; // pushback
                char[] contents = parseEntityValue(id, contentLoc, c);
                ent = new IntEntity(evtLoc, id, getSource(), contents,
                                    contentLoc);
            } else {
View Full Code Here

        /* Ok, event needs to know its exact starting point (opening '<'
         * char), let's get that info now (note: data has been preserved
         * earlier)
         */
        Location evtLoc = getStartLocation();
        NotationDeclaration nd = new WNotationDeclaration(evtLoc, id, pubId, sysId, baseURL);

        // Any definitions from the internal subset?
        if (mPredefdNotations != null) {
            NotationDeclaration oldDecl = mPredefdNotations.get(id);
View Full Code Here

    protected void handleUndeclaredEntity(String id)
        throws XMLStreamException
    {
        _reportVCViolation("Undeclared parameter entity '"+id+"'.");
        if (mCurrAttrDefault != null) {
            Location loc = getLastCharLocation();
            if (mExpandingPE) {
                mCurrAttrDefault.addUndeclaredPE(id, loc);
            } else {
                mCurrAttrDefault.addUndeclaredGE(id, loc);
            }
View Full Code Here

    protected void _reportProblem(XMLReporter rep, XMLValidationProblem prob)
        throws XMLStreamException
    {
        if (rep != null) {
            Location loc = prob.getLocation();
            if (loc == null) {
                loc = getLastCharLocation();
                prob.setLocation(loc);
            }
            // Backwards-compatibility fix: add non-null type, if missing:
View Full Code Here

            throw _notAccessible("getLocation");
        }
        // Let's try to get actual exact location via Stax2 first:
        LocationInfo li = mStreamReader.getLocationInfo();
        if (li != null) {
            Location loc = li.getStartLocation();
            if (loc != null) {
                return loc;
            }
        }
        // If not, fall back to regular method
View Full Code Here

TOP

Related Classes of javax.xml.stream.Location

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.