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


Java XML11Char.isXML11ValidLiteral方法代码示例

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


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

示例1: printXMLChar

import com.sun.org.apache.xerces.internal.util.XML11Char; //导入方法依赖的package包/类
protected final void printXMLChar( int ch ) throws IOException {

        if (ch == '\r' || ch == 0x0085 || ch == 0x2028) {
                        printHex(ch);
        } else if ( ch == '<') {
            _printer.printText("&lt;");
        } else if (ch == '&') {
            _printer.printText("&amp;");
                } else if (ch == '>'){
                        // character sequence "]]>" can't appear in content, therefore
                        // we should escape '>'
                        _printer.printText("&gt;");
        } else if ( _encodingInfo.isPrintable((char)ch) && XML11Char.isXML11ValidLiteral(ch)) {
            _printer.printText((char)ch);
        } else {
             printHex(ch);
        }
    }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:XML11Serializer.java

示例2: printXMLChar

import com.sun.org.apache.xerces.internal.util.XML11Char; //导入方法依赖的package包/类
protected final void printXMLChar( int ch ) throws IOException {

        if (ch == '\r' || ch == 0x0085 || ch == 0x2028) {
            printHex(ch);
        }
        else if ( ch == '<') {
            _printer.printText("&lt;");
        }
        else if (ch == '&') {
            _printer.printText("&amp;");
        }
        else if (ch == '>'){
            // character sequence "]]>" can't appear in content, therefore
            // we should escape '>'
            _printer.printText("&gt;");
        }
        else if ( _encodingInfo.isPrintable((char)ch) && XML11Char.isXML11ValidLiteral(ch)) {
            _printer.printText((char)ch);
        }
        else {
            printHex(ch);
        }
    }
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:24,代码来源:XML11Serializer.java

示例3: isInvalidLiteral

import com.sun.org.apache.xerces.internal.util.XML11Char; //导入方法依赖的package包/类
protected boolean isInvalidLiteral(int value) {
    return (!XML11Char.isXML11ValidLiteral(value));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:XML11DTDScannerImpl.java

示例4: printText

import com.sun.org.apache.xerces.internal.util.XML11Char; //导入方法依赖的package包/类
protected void printText( String text, boolean preserveSpace, boolean unescaped )
throws IOException {
    int index;
    char ch;
    int length = text.length();
    if ( preserveSpace ) {
        // Preserving spaces: the text must print exactly as it is,
        // without breaking when spaces appear in the text and without
        // consolidating spaces. If a line terminator is used, a line
        // break will occur.
        for ( index = 0 ; index < length ; ++index ) {
            ch = text.charAt( index );
            if (!XML11Char.isXML11Valid(ch)) {
                // check if it is surrogate
                if (++index <length) {
                    surrogates(ch, text.charAt(index));
                } else {
                    fatalError("The character '"+(char)ch+"' is an invalid XML character");
                }
                continue;
            }
            if ( unescaped  && XML11Char.isXML11ValidLiteral(ch)) {
                _printer.printText( ch );
            } else
                printXMLChar( ch );
        }
    } else {
        // Not preserving spaces: print one part at a time, and
        // use spaces between parts to break them into different
        // lines. Spaces at beginning of line will be stripped
        // by printing mechanism. Line terminator is treated
        // no different than other text part.
        for ( index = 0 ; index < length ; ++index ) {
            ch = text.charAt( index );
            if (!XML11Char.isXML11Valid(ch)) {
                // check if it is surrogate
                if (++index <length) {
                    surrogates(ch, text.charAt(index));
                } else {
                    fatalError("The character '"+(char)ch+"' is an invalid XML character");
                }
                continue;
            }

            if ( unescaped && XML11Char.isXML11ValidLiteral(ch) )
                _printer.printText( ch );
            else
                printXMLChar( ch);
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:52,代码来源:XML11Serializer.java

示例5: printText

import com.sun.org.apache.xerces.internal.util.XML11Char; //导入方法依赖的package包/类
protected void printText( String text, boolean preserveSpace, boolean unescaped )
throws IOException {
    int index;
    char ch;
    int length = text.length();
    if ( preserveSpace ) {
        // Preserving spaces: the text must print exactly as it is,
        // without breaking when spaces appear in the text and without
        // consolidating spaces. If a line terminator is used, a line
        // break will occur.
        for ( index = 0 ; index < length ; ++index ) {
            ch = text.charAt( index );
            if (!XML11Char.isXML11Valid(ch)) {
                // check if it is surrogate
                if (++index <length) {
                    surrogates(ch, text.charAt(index), true);
                } else {
                    fatalError("The character '"+ch+"' is an invalid XML character");
                }
                continue;
            }
            if ( unescaped  && XML11Char.isXML11ValidLiteral(ch)) {
                _printer.printText( ch );
            }
            else {
                printXMLChar( ch );
            }
        }
    }
    else {
        // Not preserving spaces: print one part at a time, and
        // use spaces between parts to break them into different
        // lines. Spaces at beginning of line will be stripped
        // by printing mechanism. Line terminator is treated
        // no different than other text part.
        for ( index = 0 ; index < length ; ++index ) {
            ch = text.charAt( index );
            if (!XML11Char.isXML11Valid(ch)) {
                // check if it is surrogate
                if (++index <length) {
                    surrogates(ch, text.charAt(index), true);
                } else {
                    fatalError("The character '"+ch+"' is an invalid XML character");
                }
                continue;
            }

            if ( unescaped && XML11Char.isXML11ValidLiteral(ch) ) {
                _printer.printText( ch );
            }
            else {
                printXMLChar( ch );
            }
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:57,代码来源:XML11Serializer.java


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