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


Java XMLChar.supplemental方法代码示例

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


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

示例1: scanSurrogates

import org.apache.xerces.util.XMLChar; //导入方法依赖的package包/类
private boolean scanSurrogates(XMLStringBuffer buf) throws IOException, TmxEndEntityException {
	int high = entityScanner.scanChar();
	int low = entityScanner.peekChar();
	if (!XMLChar.isLowSurrogate(low)) {
		error("invalid char in content");
		return false;
	}

	entityScanner.scanChar();

	int c = XMLChar.supplemental((char) high, (char) low);

	if (XMLChar.isInvalid(c)) {
		error("invalid char in content");
		return false;
	}

	// fill in the buffer
	buf.append((char) high);
	buf.append((char) low);

	return true;
}
 
开发者ID:heartsome,项目名称:tmxeditor8,代码行数:24,代码来源:TmxScanner2.java

示例2: scanSurrogates

import org.apache.xerces.util.XMLChar; //导入方法依赖的package包/类
private boolean scanSurrogates(XMLStringBuffer buf) throws IOException {
	int high = entityScanner.scanChar();
	int low = entityScanner.peekChar();
	if (!XMLChar.isLowSurrogate(low)) {
		error("invalid char in content");
		return false;
	}
	entityScanner.scanChar();

	int c = XMLChar.supplemental((char) high, (char) low);

	// supplemental character must be a valid XML character
	if (XMLChar.isInvalid(c)) {
		error("invalid char in content");
		return false;
	}

	// fill in the buffer
	buf.append((char) high);
	buf.append((char) low);

	return true;
}
 
开发者ID:heartsome,项目名称:tmxeditor8,代码行数:24,代码来源:TmxScanner.java

示例3: scanSurrogates

import org.apache.xerces.util.XMLChar; //导入方法依赖的package包/类
/**
 * Scans surrogates and append them to the specified buffer.
 * <p>
 * <strong>Note:</strong> This assumes the current char has already been
 * identified as a high surrogate.
 *
 * @param buf The StringBuffer to append the read surrogates to.
 * @return True if it succeeded.
 */
protected boolean scanSurrogates(XMLStringBuffer buf)
    throws IOException, XNIException {

    int high = fEntityScanner.scanChar();
    int low = fEntityScanner.peekChar();
    if (!XMLChar.isLowSurrogate(low)) {
        reportFatalError("InvalidCharInContent",
                         new Object[] {Integer.toString(high, 16)});
        return false;
    }
    fEntityScanner.scanChar();

    // convert surrogates to supplemental character
    int c = XMLChar.supplemental((char)high, (char)low);

    // supplemental character must be a valid XML character
    if (isInvalid(c)) {
        reportFatalError("InvalidCharInContent",
                         new Object[]{Integer.toString(c, 16)}); 
        return false;
    }

    // fill in the buffer
    buf.append((char)high);
    buf.append((char)low);

    return true;

}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:39,代码来源:XMLScanner.java

示例4: surrogates

import org.apache.xerces.util.XMLChar; //导入方法依赖的package包/类
protected final void surrogates(int high, int low, boolean inContent) throws IOException{
    if (XMLChar.isHighSurrogate(high)) {
        if (!XMLChar.isLowSurrogate(low)) {
            //Invalid XML
            fatalError("The character '"+(char)low+"' is an invalid XML character"); 
        }
        else {
            int supplemental = XMLChar.supplemental((char)high, (char)low);
            if (!XML11Char.isXML11Valid(supplemental)) {
                //Invalid XML
                fatalError("The character '"+(char)supplemental+"' is an invalid XML character"); 
            }
            else {
                if (inContent && content().inCData) {
                    _printer.printText("]]>&#x");                        
                    _printer.printText(Integer.toHexString(supplemental));                        
                    _printer.printText(";<![CDATA[");
                }  
                else {
		printHex(supplemental);
                }
            }
        }
    } 
    else {
        fatalError("The character '"+(char)high+"' is an invalid XML character"); 
    }

}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:30,代码来源:XML11Serializer.java

示例5: surrogates

import org.apache.xerces.util.XMLChar; //导入方法依赖的package包/类
protected void surrogates(int high, int low, boolean inContent) throws IOException{
    if (XMLChar.isHighSurrogate(high)) {
        if (!XMLChar.isLowSurrogate(low)) {
            //Invalid XML
            fatalError("The character '"+(char)low+"' is an invalid XML character"); 
        }
        else {
            int supplemental = XMLChar.supplemental((char)high, (char)low);
            if (!XMLChar.isValid(supplemental)) {
                //Invalid XML
                fatalError("The character '"+(char)supplemental+"' is an invalid XML character"); 
            }
            else {
                if (inContent && content().inCData) {
                    _printer.printText("]]>&#x");                        
                    _printer.printText(Integer.toHexString(supplemental));                        
                    _printer.printText(";<![CDATA[");
                }  
                else {
                    printHex(supplemental);
                }
            }
        }
    } else {
        fatalError("The character '"+(char)high+"' is an invalid XML character"); 
    }

}
 
开发者ID:AaronZhangL,项目名称:SplitCharater,代码行数:29,代码来源:BaseMarkupSerializer.java


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