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


Java XMLChar.isPubid方法代码示例

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


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

示例1: scanPubidLiteral

import com.sun.org.apache.xerces.internal.util.XMLChar; //导入方法依赖的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

示例2: scanPubidLiteral

import com.sun.org.apache.xerces.internal.util.XMLChar; //导入方法依赖的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

示例3: scanPubidLiteral

import com.sun.org.apache.xerces.internal.util.XMLChar; //导入方法依赖的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

示例4: scanPubidLiteral

import com.sun.org.apache.xerces.internal.util.XMLChar; //导入方法依赖的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

示例5: scanPubidLiteral

import com.sun.org.apache.xerces.internal.util.XMLChar; //导入方法依赖的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

示例6: scanPubidLiteral

import com.sun.org.apache.xerces.internal.util.XMLChar; //导入方法依赖的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.util.XMLChar.isPubid方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。