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