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


Java XMLString.setValues方法代码示例

本文整理汇总了Java中com.sun.org.apache.xerces.internal.xni.XMLString.setValues方法的典型用法代码示例。如果您正苦于以下问题:Java XMLString.setValues方法的具体用法?Java XMLString.setValues怎么用?Java XMLString.setValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.org.apache.xerces.internal.xni.XMLString的用法示例。


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

示例1: scanPseudoAttribute

import com.sun.org.apache.xerces.internal.xni.XMLString; //导入方法依赖的package包/类
/**
 * Scans a pseudo attribute.
 *
 * @param scanningTextDecl True if scanning this pseudo-attribute for a
 *                         TextDecl; false if scanning XMLDecl. This
 *                         flag is needed to report the correct type of
 *                         error.
 * @param value            The string to fill in with the attribute
 *                         value.
 *
 * @return The name of the attribute
 *
 * <strong>Note:</strong> This method uses fStringBuffer2, anything in it
 * at the time of calling is lost.
 */
public String scanPseudoAttribute(boolean scanningTextDecl,
        XMLString value)
        throws IOException, XNIException {

    String name = scanPseudoAttributeName();
    // XMLEntityManager.print(fEntityManager.getCurrentEntity());

    if (name == null) {
        reportFatalError("PseudoAttrNameExpected", null);
    }
    fEntityScanner.skipSpaces();
    if (!fEntityScanner.skipChar('=')) {
        reportFatalError(scanningTextDecl ? "EqRequiredInTextDecl"
                : "EqRequiredInXMLDecl", new Object[]{name});
    }
    fEntityScanner.skipSpaces();
    int quote = fEntityScanner.peekChar();
    if (quote != '\'' && quote != '"') {
        reportFatalError(scanningTextDecl ? "QuoteRequiredInTextDecl"
                : "QuoteRequiredInXMLDecl" , new Object[]{name});
    }
    fEntityScanner.scanChar();
    int c = fEntityScanner.scanLiteral(quote, value);
    if (c != quote) {
        fStringBuffer2.clear();
        do {
            fStringBuffer2.append(value);
            if (c != -1) {
                if (c == '&' || c == '%' || c == '<' || c == ']') {
                    fStringBuffer2.append((char)fEntityScanner.scanChar());
                } else if (XMLChar.isHighSurrogate(c)) {
                    scanSurrogates(fStringBuffer2);
                } else if (isInvalidLiteral(c)) {
                    String key = scanningTextDecl
                            ? "InvalidCharInTextDecl" : "InvalidCharInXMLDecl";
                    reportFatalError(key,
                            new Object[] {Integer.toString(c, 16)});
                            fEntityScanner.scanChar();
                }
            }
            c = fEntityScanner.scanLiteral(quote, value);
        } while (c != quote);
        fStringBuffer2.append(value);
        value.setValues(fStringBuffer2);
    }
    if (!fEntityScanner.skipChar(quote)) {
        reportFatalError(scanningTextDecl ? "CloseQuoteMissingInTextDecl"
                : "CloseQuoteMissingInXMLDecl",
                new Object[]{name});
    }

    // return
    return name;

}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:71,代码来源:XMLScanner.java

示例2: scanPubidLiteral

import com.sun.org.apache.xerces.internal.xni.XMLString; //导入方法依赖的package包/类
/**
 * Scans public ID literal.
 *
 * [12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'"
 * [13] PubidChar::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]
 *
 * The returned string is normalized according to the following rule,
 * from http://www.w3.org/TR/REC-xml#dt-pubid:
 *
 * Before a match is attempted, all strings of white space in the public
 * identifier must be normalized to single space characters (#x20), and
 * leading and trailing white space must be removed.
 *
 * @param literal The string to fill in with the public ID literal.
 * @return True on success.
 *
 * <strong>Note:</strong> This method uses fStringBuffer, anything in it at
 * the time of calling is lost.
 */
protected boolean scanPubidLiteral(XMLString literal)
throws IOException, XNIException {
    int quote = fEntityScanner.scanChar();
    if (quote != '\'' && quote != '"') {
        reportFatalError("QuoteRequiredInPublicID", null);
        return false;
    }

    fStringBuffer.clear();
    // skip leading whitespace
    boolean skipSpace = true;
    boolean dataok = true;
    while (true) {
        int c = fEntityScanner.scanChar();
        if (c == ' ' || c == '\n' || c == '\r') {
            if (!skipSpace) {
                // take the first whitespace as a space and skip the others
                fStringBuffer.append(' ');
                skipSpace = true;
            }
        } else if (c == quote) {
            if (skipSpace) {
                // if we finished on a space let's trim it
                fStringBuffer.length--;
            }
            literal.setValues(fStringBuffer);
            break;
        } else if (XMLChar.isPubid(c)) {
            fStringBuffer.append((char)c);
            skipSpace = false;
        } else if (c == -1) {
            reportFatalError("PublicIDUnterminated", null);
            return false;
        } else {
            dataok = false;
            reportFatalError("InvalidCharInPublicID",
                    new Object[]{Integer.toHexString(c)});
        }
    }
    return dataok;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:61,代码来源:XMLScanner.java

示例3: scanPubidLiteral

import com.sun.org.apache.xerces.internal.xni.XMLString; //导入方法依赖的package包/类
/**
  * Scans public ID literal.
  *
  * [12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'"
  * [13] PubidChar::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]
  *
  * The returned string is normalized according to the following rule,
  * from http://www.w3.org/TR/REC-xml#dt-pubid:
  *
  * Before a match is attempted, all strings of white space in the public
  * identifier must be normalized to single space characters (#x20), and
  * leading and trailing white space must be removed.
  *
  * @param literal The string to fill in with the public ID literal.
  * @return True on success.
  *
  * <strong>Note:</strong> This method uses fStringBuffer, anything in it at
  * the time of calling is lost.
  */
 protected boolean scanPubidLiteral(XMLString literal)
     throws IOException, XNIException
 {
     int quote = fEntityScanner.scanChar();
     if (quote != '\'' && quote != '"') {
         reportFatalError("QuoteRequiredInPublicID", null);
         return false;
     }

     fStringBuffer.clear();
     // skip leading whitespace
     boolean skipSpace = true;
     boolean dataok = true;
     while (true) {
         int c = fEntityScanner.scanChar();
         // REVISIT:  it could really only be \n or 0x20; all else is normalized, no?  - neilg
         if (c == ' ' || c == '\n' || c == '\r' || c == 0x85 || c == 0x2028) {
             if (!skipSpace) {
                 // take the first whitespace as a space and skip the others
                 fStringBuffer.append(' ');
                 skipSpace = true;
             }
         }
         else if (c == quote) {
             if (skipSpace) {
                 // if we finished on a space let's trim it
                 fStringBuffer.length--;
             }
             literal.setValues(fStringBuffer);
             break;
         }
         else if (XMLChar.isPubid(c)) {
             fStringBuffer.append((char)c);
             skipSpace = false;
         }
         else if (c == -1) {
             reportFatalError("PublicIDUnterminated", null);
             return false;
         }
         else {
             dataok = false;
             reportFatalError("InvalidCharInPublicID",
                              new Object[]{Integer.toHexString(c)});
         }
     }
     return dataok;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:67,代码来源:XML11DTDScannerImpl.java

示例4: scanPubidLiteral

import com.sun.org.apache.xerces.internal.xni.XMLString; //导入方法依赖的package包/类
/**
  * Scans public ID literal.
  *
  * [12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'"
  * [13] PubidChar::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]
  *
  * The returned string is normalized according to the following rule,
  * from http://www.w3.org/TR/REC-xml#dt-pubid:
  *
  * Before a match is attempted, all strings of white space in the public
  * identifier must be normalized to single space characters (#x20), and
  * leading and trailing white space must be removed.
  *
  * @param literal The string to fill in with the public ID literal.
  * @return True on success.
  *
  * <strong>Note:</strong> This method uses fStringBuffer, anything in it at
  * the time of calling is lost.
  */
 protected boolean scanPubidLiteral(XMLString literal)
     throws IOException, XNIException
 {
     int quote = fEntityScanner.scanChar();
     if (quote != '\'' && quote != '"') {
         reportFatalError("QuoteRequiredInPublicID", null);
         return false;
     }

     fStringBuffer.clear();
     // skip leading whitespace
     boolean skipSpace = true;
     boolean dataok = true;
     while (true) {
         int c = fEntityScanner.scanChar();
         // REVISIT:  none of these except \n and 0x20 should make it past the entity scanner
         if (c == ' ' || c == '\n' || c == '\r' || c == 0x85 || c == 0x2028) {
             if (!skipSpace) {
                 // take the first whitespace as a space and skip the others
                 fStringBuffer.append(' ');
                 skipSpace = true;
             }
         }
         else if (c == quote) {
             if (skipSpace) {
                 // if we finished on a space let's trim it
                 fStringBuffer.length--;
             }
             literal.setValues(fStringBuffer);
             break;
         }
         else if (XMLChar.isPubid(c)) {
             fStringBuffer.append((char)c);
             skipSpace = false;
         }
         else if (c == -1) {
             reportFatalError("PublicIDUnterminated", null);
             return false;
         }
         else {
             dataok = false;
             reportFatalError("InvalidCharInPublicID",
                              new Object[]{Integer.toHexString(c)});
         }
     }
     return dataok;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:67,代码来源:XML11DocumentScannerImpl.java

示例5: scanPseudoAttribute

import com.sun.org.apache.xerces.internal.xni.XMLString; //导入方法依赖的package包/类
/**
 * Scans a pseudo attribute.
 *
 * @param scanningTextDecl True if scanning this pseudo-attribute for a
 *                         TextDecl; false if scanning XMLDecl. This
 *                         flag is needed to report the correct type of
 *                         error.
 * @param value            The string to fill in with the attribute
 *                         value.
 *
 * @return The name of the attribute
 *
 * <strong>Note:</strong> This method uses fStringBuffer2, anything in it
 * at the time of calling is lost.
 */
protected String scanPseudoAttribute(boolean scanningTextDecl,
        XMLString value)
        throws IOException, XNIException {

    String name = scanPseudoAttributeName();
    // XMLEntityManager.print(fEntityManager.getCurrentEntity());

    if (name == null) {
        reportFatalError("PseudoAttrNameExpected", null);
    }
    fEntityScanner.skipSpaces();
    if (!fEntityScanner.skipChar('=', null)) {
        reportFatalError(scanningTextDecl ? "EqRequiredInTextDecl"
                : "EqRequiredInXMLDecl", new Object[]{name});
    }
    fEntityScanner.skipSpaces();
    int quote = fEntityScanner.peekChar();
    if (quote != '\'' && quote != '"') {
        reportFatalError(scanningTextDecl ? "QuoteRequiredInTextDecl"
                : "QuoteRequiredInXMLDecl" , new Object[]{name});
    }
    fEntityScanner.scanChar(NameType.ATTRIBUTE);
    int c = fEntityScanner.scanLiteral(quote, value, false);
    if (c != quote) {
        fStringBuffer2.clear();
        do {
            fStringBuffer2.append(value);
            if (c != -1) {
                if (c == '&' || c == '%' || c == '<' || c == ']') {
                    fStringBuffer2.append((char)fEntityScanner.scanChar(NameType.ATTRIBUTE));
                } else if (XMLChar.isHighSurrogate(c)) {
                    scanSurrogates(fStringBuffer2);
                } else if (isInvalidLiteral(c)) {
                    String key = scanningTextDecl
                            ? "InvalidCharInTextDecl" : "InvalidCharInXMLDecl";
                    reportFatalError(key,
                            new Object[] {Integer.toString(c, 16)});
                            fEntityScanner.scanChar(null);
                }
            }
            c = fEntityScanner.scanLiteral(quote, value, false);
        } while (c != quote);
        fStringBuffer2.append(value);
        value.setValues(fStringBuffer2);
    }
    if (!fEntityScanner.skipChar(quote, null)) {
        reportFatalError(scanningTextDecl ? "CloseQuoteMissingInTextDecl"
                : "CloseQuoteMissingInXMLDecl",
                new Object[]{name});
    }

    // return
    return name;

}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:71,代码来源:XMLScanner.java

示例6: scanPubidLiteral

import com.sun.org.apache.xerces.internal.xni.XMLString; //导入方法依赖的package包/类
/**
 * Scans public ID literal.
 *
 * [12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'"
 * [13] PubidChar::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]
 *
 * The returned string is normalized according to the following rule,
 * from http://www.w3.org/TR/REC-xml#dt-pubid:
 *
 * Before a match is attempted, all strings of white space in the public
 * identifier must be normalized to single space characters (#x20), and
 * leading and trailing white space must be removed.
 *
 * @param literal The string to fill in with the public ID literal.
 * @return True on success.
 *
 * <strong>Note:</strong> This method uses fStringBuffer, anything in it at
 * the time of calling is lost.
 */
protected boolean scanPubidLiteral(XMLString literal)
throws IOException, XNIException {
    int quote = fEntityScanner.scanChar(null);
    if (quote != '\'' && quote != '"') {
        reportFatalError("QuoteRequiredInPublicID", null);
        return false;
    }

    fStringBuffer.clear();
    // skip leading whitespace
    boolean skipSpace = true;
    boolean dataok = true;
    while (true) {
        int c = fEntityScanner.scanChar(null);
        if (c == ' ' || c == '\n' || c == '\r') {
            if (!skipSpace) {
                // take the first whitespace as a space and skip the others
                fStringBuffer.append(' ');
                skipSpace = true;
            }
        } else if (c == quote) {
            if (skipSpace) {
                // if we finished on a space let's trim it
                fStringBuffer.length--;
            }
            literal.setValues(fStringBuffer);
            break;
        } else if (XMLChar.isPubid(c)) {
            fStringBuffer.append((char)c);
            skipSpace = false;
        } else if (c == -1) {
            reportFatalError("PublicIDUnterminated", null);
            return false;
        } else {
            dataok = false;
            reportFatalError("InvalidCharInPublicID",
                    new Object[]{Integer.toHexString(c)});
        }
    }
    return dataok;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:61,代码来源:XMLScanner.java

示例7: scanPubidLiteral

import com.sun.org.apache.xerces.internal.xni.XMLString; //导入方法依赖的package包/类
/**
  * Scans public ID literal.
  *
  * [12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'"
  * [13] PubidChar::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]
  *
  * The returned string is normalized according to the following rule,
  * from http://www.w3.org/TR/REC-xml#dt-pubid:
  *
  * Before a match is attempted, all strings of white space in the public
  * identifier must be normalized to single space characters (#x20), and
  * leading and trailing white space must be removed.
  *
  * @param literal The string to fill in with the public ID literal.
  * @return True on success.
  *
  * <strong>Note:</strong> This method uses fStringBuffer, anything in it at
  * the time of calling is lost.
  */
 protected boolean scanPubidLiteral(XMLString literal)
     throws IOException, XNIException
 {
     int quote = fEntityScanner.scanChar(null);
     if (quote != '\'' && quote != '"') {
         reportFatalError("QuoteRequiredInPublicID", null);
         return false;
     }

     fStringBuffer.clear();
     // skip leading whitespace
     boolean skipSpace = true;
     boolean dataok = true;
     while (true) {
         int c = fEntityScanner.scanChar(null);
         // REVISIT:  it could really only be \n or 0x20; all else is normalized, no?  - neilg
         if (c == ' ' || c == '\n' || c == '\r' || c == 0x85 || c == 0x2028) {
             if (!skipSpace) {
                 // take the first whitespace as a space and skip the others
                 fStringBuffer.append(' ');
                 skipSpace = true;
             }
         }
         else if (c == quote) {
             if (skipSpace) {
                 // if we finished on a space let's trim it
                 fStringBuffer.length--;
             }
             literal.setValues(fStringBuffer);
             break;
         }
         else if (XMLChar.isPubid(c)) {
             fStringBuffer.append((char)c);
             skipSpace = false;
         }
         else if (c == -1) {
             reportFatalError("PublicIDUnterminated", null);
             return false;
         }
         else {
             dataok = false;
             reportFatalError("InvalidCharInPublicID",
                              new Object[]{Integer.toHexString(c)});
         }
     }
     return dataok;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:67,代码来源:XML11DTDScannerImpl.java

示例8: scanPubidLiteral

import com.sun.org.apache.xerces.internal.xni.XMLString; //导入方法依赖的package包/类
/**
  * Scans public ID literal.
  *
  * [12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'"
  * [13] PubidChar::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]
  *
  * The returned string is normalized according to the following rule,
  * from http://www.w3.org/TR/REC-xml#dt-pubid:
  *
  * Before a match is attempted, all strings of white space in the public
  * identifier must be normalized to single space characters (#x20), and
  * leading and trailing white space must be removed.
  *
  * @param literal The string to fill in with the public ID literal.
  * @return True on success.
  *
  * <strong>Note:</strong> This method uses fStringBuffer, anything in it at
  * the time of calling is lost.
  */
 protected boolean scanPubidLiteral(XMLString literal)
     throws IOException, XNIException
 {
     int quote = fEntityScanner.scanChar(null);
     if (quote != '\'' && quote != '"') {
         reportFatalError("QuoteRequiredInPublicID", null);
         return false;
     }

     fStringBuffer.clear();
     // skip leading whitespace
     boolean skipSpace = true;
     boolean dataok = true;
     while (true) {
         int c = fEntityScanner.scanChar(null);
         // REVISIT:  none of these except \n and 0x20 should make it past the entity scanner
         if (c == ' ' || c == '\n' || c == '\r' || c == 0x85 || c == 0x2028) {
             if (!skipSpace) {
                 // take the first whitespace as a space and skip the others
                 fStringBuffer.append(' ');
                 skipSpace = true;
             }
         }
         else if (c == quote) {
             if (skipSpace) {
                 // if we finished on a space let's trim it
                 fStringBuffer.length--;
             }
             literal.setValues(fStringBuffer);
             break;
         }
         else if (XMLChar.isPubid(c)) {
             fStringBuffer.append((char)c);
             skipSpace = false;
         }
         else if (c == -1) {
             reportFatalError("PublicIDUnterminated", null);
             return false;
         }
         else {
             dataok = false;
             reportFatalError("InvalidCharInPublicID",
                              new Object[]{Integer.toHexString(c)});
         }
     }
     return dataok;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:67,代码来源:XML11DocumentScannerImpl.java


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