Java Code Examples for com.sun.org.apache.xerces.internal.util.XMLStringBuffer#clear()

The following examples show how to use com.sun.org.apache.xerces.internal.util.XMLStringBuffer#clear() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XMLScanner.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Scans a comment.
 * <p>
 * <pre>
 * [15] Comment ::= '&lt!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
 * </pre>
 * <p>
 * <strong>Note:</strong> Called after scanning past '&lt;!--'
 * <strong>Note:</strong> This method uses fString, anything in it
 * at the time of calling is lost.
 *
 * @param text The buffer to fill in with the text.
 */
protected void scanComment(XMLStringBuffer text)
throws IOException, XNIException {

    //System.out.println( "XMLScanner#scanComment# In Scan Comment" );
    // text
    // REVISIT: handle invalid character, eof
    text.clear();
    while (fEntityScanner.scanData("--", text)) {
        int c = fEntityScanner.peekChar();

        //System.out.println( "XMLScanner#scanComment#text.toString() == " + text.toString() );
        //System.out.println( "XMLScanner#scanComment#c == " + c );

        if (c != -1) {
            if (XMLChar.isHighSurrogate(c)) {
                scanSurrogates(text);
            }
            else if (isInvalidLiteral(c)) {
                reportFatalError("InvalidCharInComment",
                        new Object[] { Integer.toHexString(c) });
                        fEntityScanner.scanChar(NameType.COMMENT);
            }
        }
    }
    if (!fEntityScanner.skipChar('>', NameType.COMMENT)) {
        reportFatalError("DashDashInComment", null);
    }

}
 
Example 2
Source File: XMLScanner.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Scans a comment.
 * <p>
 * <pre>
 * [15] Comment ::= '&lt!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
 * </pre>
 * <p>
 * <strong>Note:</strong> Called after scanning past '&lt;!--'
 * <strong>Note:</strong> This method uses fString, anything in it
 * at the time of calling is lost.
 *
 * @param text The buffer to fill in with the text.
 */
protected void scanComment(XMLStringBuffer text)
throws IOException, XNIException {

    //System.out.println( "XMLScanner#scanComment# In Scan Comment" );
    // text
    // REVISIT: handle invalid character, eof
    text.clear();
    while (fEntityScanner.scanData("--", text)) {
        int c = fEntityScanner.peekChar();

        //System.out.println( "XMLScanner#scanComment#text.toString() == " + text.toString() );
        //System.out.println( "XMLScanner#scanComment#c == " + c );

        if (c != -1) {
            if (XMLChar.isHighSurrogate(c)) {
                scanSurrogates(text);
            }
            else if (isInvalidLiteral(c)) {
                reportFatalError("InvalidCharInComment",
                        new Object[] { Integer.toHexString(c) });
                        fEntityScanner.scanChar(NameType.COMMENT);
            }
        }
    }
    if (!fEntityScanner.skipChar('>', NameType.COMMENT)) {
        reportFatalError("DashDashInComment", null);
    }

}
 
Example 3
Source File: XMLScanner.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Scans a comment.
 * <p>
 * <pre>
 * [15] Comment ::= '&lt!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
 * </pre>
 * <p>
 * <strong>Note:</strong> Called after scanning past '&lt;!--'
 * <strong>Note:</strong> This method uses fString, anything in it
 * at the time of calling is lost.
 *
 * @param text The buffer to fill in with the text.
 */
protected void scanComment(XMLStringBuffer text)
throws IOException, XNIException {

    //System.out.println( "XMLScanner#scanComment# In Scan Comment" );
    // text
    // REVISIT: handle invalid character, eof
    text.clear();
    while (fEntityScanner.scanData("--", text)) {
        int c = fEntityScanner.peekChar();

        //System.out.println( "XMLScanner#scanComment#text.toString() == " + text.toString() );
        //System.out.println( "XMLScanner#scanComment#c == " + c );

        if (c != -1) {
            if (XMLChar.isHighSurrogate(c)) {
                scanSurrogates(text);
            }
            if (isInvalidLiteral(c)) {
                reportFatalError("InvalidCharInComment",
                        new Object[] { Integer.toHexString(c) });
                        fEntityScanner.scanChar();
            }
        }
    }
    if (!fEntityScanner.skipChar('>')) {
        reportFatalError("DashDashInComment", null);
    }

}
 
Example 4
Source File: XMLScanner.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Scans a comment.
 * <p>
 * <pre>
 * [15] Comment ::= '&lt!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
 * </pre>
 * <p>
 * <strong>Note:</strong> Called after scanning past '&lt;!--'
 * <strong>Note:</strong> This method uses fString, anything in it
 * at the time of calling is lost.
 *
 * @param text The buffer to fill in with the text.
 */
protected void scanComment(XMLStringBuffer text)
throws IOException, XNIException {

    //System.out.println( "XMLScanner#scanComment# In Scan Comment" );
    // text
    // REVISIT: handle invalid character, eof
    text.clear();
    while (fEntityScanner.scanData("--", text)) {
        int c = fEntityScanner.peekChar();

        //System.out.println( "XMLScanner#scanComment#text.toString() == " + text.toString() );
        //System.out.println( "XMLScanner#scanComment#c == " + c );

        if (c != -1) {
            if (XMLChar.isHighSurrogate(c)) {
                scanSurrogates(text);
            }
            else if (isInvalidLiteral(c)) {
                reportFatalError("InvalidCharInComment",
                        new Object[] { Integer.toHexString(c) });
                        fEntityScanner.scanChar(NameType.COMMENT);
            }
        }
    }
    if (!fEntityScanner.skipChar('>', NameType.COMMENT)) {
        reportFatalError("DashDashInComment", null);
    }

}
 
Example 5
Source File: XMLScanner.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Scans a comment.
 * <p>
 * <pre>
 * [15] Comment ::= '&lt!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
 * </pre>
 * <p>
 * <strong>Note:</strong> Called after scanning past '&lt;!--'
 * <strong>Note:</strong> This method uses fString, anything in it
 * at the time of calling is lost.
 *
 * @param text The buffer to fill in with the text.
 */
protected void scanComment(XMLStringBuffer text)
throws IOException, XNIException {

    //System.out.println( "XMLScanner#scanComment# In Scan Comment" );
    // text
    // REVISIT: handle invalid character, eof
    text.clear();
    while (fEntityScanner.scanData("--", text)) {
        int c = fEntityScanner.peekChar();

        //System.out.println( "XMLScanner#scanComment#text.toString() == " + text.toString() );
        //System.out.println( "XMLScanner#scanComment#c == " + c );

        if (c != -1) {
            if (XMLChar.isHighSurrogate(c)) {
                scanSurrogates(text);
            }
            else if (isInvalidLiteral(c)) {
                reportFatalError("InvalidCharInComment",
                        new Object[] { Integer.toHexString(c) });
                        fEntityScanner.scanChar(NameType.COMMENT);
            }
        }
    }
    if (!fEntityScanner.skipChar('>', NameType.COMMENT)) {
        reportFatalError("DashDashInComment", null);
    }

}
 
Example 6
Source File: XMLScanner.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Scans a comment.
 * <p>
 * <pre>
 * [15] Comment ::= '&lt!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
 * </pre>
 * <p>
 * <strong>Note:</strong> Called after scanning past '&lt;!--'
 * <strong>Note:</strong> This method uses fString, anything in it
 * at the time of calling is lost.
 *
 * @param text The buffer to fill in with the text.
 */
protected void scanComment(XMLStringBuffer text)
throws IOException, XNIException {

    //System.out.println( "XMLScanner#scanComment# In Scan Comment" );
    // text
    // REVISIT: handle invalid character, eof
    text.clear();
    while (fEntityScanner.scanData("--", text)) {
        int c = fEntityScanner.peekChar();

        //System.out.println( "XMLScanner#scanComment#text.toString() == " + text.toString() );
        //System.out.println( "XMLScanner#scanComment#c == " + c );

        if (c != -1) {
            if (XMLChar.isHighSurrogate(c)) {
                scanSurrogates(text);
            }
            else if (isInvalidLiteral(c)) {
                reportFatalError("InvalidCharInComment",
                        new Object[] { Integer.toHexString(c) });
                        fEntityScanner.scanChar(NameType.COMMENT);
            }
        }
    }
    if (!fEntityScanner.skipChar('>', NameType.COMMENT)) {
        reportFatalError("DashDashInComment", null);
    }

}
 
Example 7
Source File: XMLScanner.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * Scans a comment.
 * <p>
 * <pre>
 * [15] Comment ::= '&lt!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
 * </pre>
 * <p>
 * <strong>Note:</strong> Called after scanning past '&lt;!--'
 * <strong>Note:</strong> This method uses fString, anything in it
 * at the time of calling is lost.
 *
 * @param text The buffer to fill in with the text.
 */
protected void scanComment(XMLStringBuffer text)
throws IOException, XNIException {

    //System.out.println( "XMLScanner#scanComment# In Scan Comment" );
    // text
    // REVISIT: handle invalid character, eof
    text.clear();
    while (fEntityScanner.scanData("--", text, 0)) {
        int c = fEntityScanner.peekChar();

        //System.out.println( "XMLScanner#scanComment#text.toString() == " + text.toString() );
        //System.out.println( "XMLScanner#scanComment#c == " + c );

        if (c != -1) {
            if (XMLChar.isHighSurrogate(c)) {
                scanSurrogates(text);
            }
            else if (isInvalidLiteral(c)) {
                reportFatalError("InvalidCharInComment",
                        new Object[] { Integer.toHexString(c) });
                        fEntityScanner.scanChar(NameType.COMMENT);
            }
        }
    }
    if (!fEntityScanner.skipChar('>', NameType.COMMENT)) {
        reportFatalError("DashDashInComment", null);
    }

}
 
Example 8
Source File: XMLScanner.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Scans a comment.
 * <p>
 * <pre>
 * [15] Comment ::= '&lt!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
 * </pre>
 * <p>
 * <strong>Note:</strong> Called after scanning past '&lt;!--'
 * <strong>Note:</strong> This method uses fString, anything in it
 * at the time of calling is lost.
 *
 * @param text The buffer to fill in with the text.
 */
protected void scanComment(XMLStringBuffer text)
throws IOException, XNIException {

    //System.out.println( "XMLScanner#scanComment# In Scan Comment" );
    // text
    // REVISIT: handle invalid character, eof
    text.clear();
    while (fEntityScanner.scanData("--", text, 0)) {
        int c = fEntityScanner.peekChar();

        //System.out.println( "XMLScanner#scanComment#text.toString() == " + text.toString() );
        //System.out.println( "XMLScanner#scanComment#c == " + c );

        if (c != -1) {
            if (XMLChar.isHighSurrogate(c)) {
                scanSurrogates(text);
            }
            else if (isInvalidLiteral(c)) {
                reportFatalError("InvalidCharInComment",
                        new Object[] { Integer.toHexString(c) });
                        fEntityScanner.scanChar(NameType.COMMENT);
            }
        }
    }
    if (!fEntityScanner.skipChar('>', NameType.COMMENT)) {
        reportFatalError("DashDashInComment", null);
    }

}
 
Example 9
Source File: XMLScanner.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Scans a comment.
 * <p>
 * <pre>
 * [15] Comment ::= '&lt!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
 * </pre>
 * <p>
 * <strong>Note:</strong> Called after scanning past '&lt;!--'
 * <strong>Note:</strong> This method uses fString, anything in it
 * at the time of calling is lost.
 *
 * @param text The buffer to fill in with the text.
 */
protected void scanComment(XMLStringBuffer text)
throws IOException, XNIException {

    //System.out.println( "XMLScanner#scanComment# In Scan Comment" );
    // text
    // REVISIT: handle invalid character, eof
    text.clear();
    while (fEntityScanner.scanData("--", text)) {
        int c = fEntityScanner.peekChar();

        //System.out.println( "XMLScanner#scanComment#text.toString() == " + text.toString() );
        //System.out.println( "XMLScanner#scanComment#c == " + c );

        if (c != -1) {
            if (XMLChar.isHighSurrogate(c)) {
                scanSurrogates(text);
            }
            else if (isInvalidLiteral(c)) {
                reportFatalError("InvalidCharInComment",
                        new Object[] { Integer.toHexString(c) });
                        fEntityScanner.scanChar();
            }
        }
    }
    if (!fEntityScanner.skipChar('>')) {
        reportFatalError("DashDashInComment", null);
    }

}
 
Example 10
Source File: XMLScanner.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Scans a comment.
 * <p>
 * <pre>
 * [15] Comment ::= '&lt!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
 * </pre>
 * <p>
 * <strong>Note:</strong> Called after scanning past '&lt;!--'
 * <strong>Note:</strong> This method uses fString, anything in it
 * at the time of calling is lost.
 *
 * @param text The buffer to fill in with the text.
 */
protected void scanComment(XMLStringBuffer text)
throws IOException, XNIException {

    //System.out.println( "XMLScanner#scanComment# In Scan Comment" );
    // text
    // REVISIT: handle invalid character, eof
    text.clear();
    while (fEntityScanner.scanData("--", text)) {
        int c = fEntityScanner.peekChar();

        //System.out.println( "XMLScanner#scanComment#text.toString() == " + text.toString() );
        //System.out.println( "XMLScanner#scanComment#c == " + c );

        if (c != -1) {
            if (XMLChar.isHighSurrogate(c)) {
                scanSurrogates(text);
            }
            if (isInvalidLiteral(c)) {
                reportFatalError("InvalidCharInComment",
                        new Object[] { Integer.toHexString(c) });
                        fEntityScanner.scanChar();
            }
        }
    }
    if (!fEntityScanner.skipChar('>')) {
        reportFatalError("DashDashInComment", null);
    }

}
 
Example 11
Source File: XMLScanner.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Scans a comment.
 * <p>
 * <pre>
 * [15] Comment ::= '&lt!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
 * </pre>
 * <p>
 * <strong>Note:</strong> Called after scanning past '&lt;!--'
 * <strong>Note:</strong> This method uses fString, anything in it
 * at the time of calling is lost.
 *
 * @param text The buffer to fill in with the text.
 */
protected void scanComment(XMLStringBuffer text)
throws IOException, XNIException {

    //System.out.println( "XMLScanner#scanComment# In Scan Comment" );
    // text
    // REVISIT: handle invalid character, eof
    text.clear();
    while (fEntityScanner.scanData("--", text)) {
        int c = fEntityScanner.peekChar();

        //System.out.println( "XMLScanner#scanComment#text.toString() == " + text.toString() );
        //System.out.println( "XMLScanner#scanComment#c == " + c );

        if (c != -1) {
            if (XMLChar.isHighSurrogate(c)) {
                scanSurrogates(text);
            }
            if (isInvalidLiteral(c)) {
                reportFatalError("InvalidCharInComment",
                        new Object[] { Integer.toHexString(c) });
                        fEntityScanner.scanChar();
            }
        }
    }
    if (!fEntityScanner.skipChar('>')) {
        reportFatalError("DashDashInComment", null);
    }

}