本文整理了Java中org.apache.xml.serializer.utils.XML11Char
类的一些代码示例,展示了XML11Char
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XML11Char
类的具体详情如下:
包路径:org.apache.xml.serializer.utils.XML11Char
类名称:XML11Char
[英]THIS IS A COPY OF THE XERCES-2J CLASS org.apache.xerces.utls.XMLChar This class defines the basic properties of characters in XML 1.1. The data in this class can be used to verify that a character is a valid XML 1.1 character or if the character is a space, name start, or name character.
A series of convenience methods are supplied to ease the burden of the developer. Using the character as an index into the XML11CHARS
array and applying the appropriate mask flag (e.g. MASK_VALID
), yields the same results as calling the convenience methods. There is one exception: check the comments for the isValid
method for details.
[中]这是XERCES-2J课程组织的副本。阿帕奇。薛西斯。utls。XMLChar这个类定义了XML 1.1中字符的基本属性。此类中的数据可用于验证字符是否为有效的XML 1.1字符,或者该字符是否为空格、名称开头或名称字符。
提供了一系列方便的方法来减轻开发人员的负担。使用该字符作为XML11CHARS
数组的索引,并应用适当的掩码标志(例如MASK_VALID
),会产生与调用便利方法相同的结果。有一个例外:查看isValid
方法的注释以了解详细信息。
代码示例来源:origin: robovm/robovm
if (XML11Char.isXML11Invalid(dataarray[i++])) {
代码示例来源:origin: robovm/robovm
int i = 1;
char ch = ncName.charAt(0);
if( !isXML11NCNameStart(ch) ) {
if ( length > 1 && isXML11NameHighSurrogate(ch) ) {
char ch2 = ncName.charAt(1);
if ( !XMLChar.isLowSurrogate(ch2) ||
!isXML11NCNameStart(XMLChar.supplemental(ch, ch2)) ) {
return false;
if ( !isXML11NCName(ch) ) {
if ( ++i < length && isXML11NameHighSurrogate(ch) ) {
char ch2 = ncName.charAt(i);
if ( !XMLChar.isLowSurrogate(ch2) ||
!isXML11NCName(XMLChar.supplemental(ch, ch2)) ) {
return false;
代码示例来源:origin: robovm/robovm
int i = 1;
char ch = name.charAt(0);
if( !isXML11NameStart(ch) ) {
if ( length > 1 && isXML11NameHighSurrogate(ch) ) {
char ch2 = name.charAt(1);
if ( !XMLChar.isLowSurrogate(ch2) ||
!isXML11NameStart(XMLChar.supplemental(ch, ch2)) ) {
return false;
if ( !isXML11Name(ch) ) {
if ( ++i < length && isXML11NameHighSurrogate(ch) ) {
char ch2 = name.charAt(i);
if ( !XMLChar.isLowSurrogate(ch2) ||
!isXML11Name(XMLChar.supplemental(ch, ch2)) ) {
return false;
代码示例来源:origin: robovm/robovm
/**
* Check to see if a string is a valid Nmtoken according to [7]
* in the XML 1.1 Recommendation
*
* @param nmtoken string to check
* @return true if nmtoken is a valid Nmtoken
*/
public static boolean isXML11ValidNmtoken(String nmtoken) {
int length = nmtoken.length();
if (length == 0)
return false;
for (int i = 0; i < length; ++i ) {
char ch = nmtoken.charAt(i);
if( !isXML11Name(ch) ) {
if ( ++i < length && isXML11NameHighSurrogate(ch) ) {
char ch2 = nmtoken.charAt(i);
if ( !XMLChar.isLowSurrogate(ch2) ||
!isXML11Name(XMLChar.supplemental(ch, ch2)) ) {
return false;
}
}
else {
return false;
}
}
}
return true;
} // isXML11ValidName(String):boolean
代码示例来源:origin: robovm/robovm
/**
* Returns true if the specified character is invalid.
*
* @param c The character to check.
*/
public static boolean isXML11Invalid(int c) {
return !isXML11Valid(c);
} // isXML11Invalid(int):boolean
代码示例来源:origin: robovm/robovm
/**
* Taken from org.apache.xerces.dom.CoreDocumentImpl
*
* Check the string against XML's definition of acceptable names for
* elements and attributes and so on using the XMLCharacterProperties
* utility class
*/
protected boolean isXMLName(String s, boolean xml11Version) {
if (s == null) {
return false;
}
if (!xml11Version)
return XMLChar.isValidName(s);
else
return XML11Char.isXML11ValidName(s);
}
代码示例来源:origin: robovm/robovm
/**
* Taken from org.apache.xerces.dom.CoreDocumentImpl
*
* Checks if the given qualified name is legal with respect
* to the version of XML to which this document must conform.
*
* @param prefix prefix of qualified name
* @param local local part of qualified name
*/
protected boolean isValidQName(
String prefix,
String local,
boolean xml11Version) {
// check that both prefix and local part match NCName
if (local == null)
return false;
boolean validNCName = false;
if (!xml11Version) {
validNCName =
(prefix == null || XMLChar.isValidNCName(prefix))
&& XMLChar.isValidNCName(local);
} else {
validNCName =
(prefix == null || XML11Char.isXML11ValidNCName(prefix))
&& XML11Char.isXML11ValidNCName(local);
}
return validNCName;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xalan
/**
* Check to see if a string is a valid Nmtoken according to [7]
* in the XML 1.1 Recommendation
*
* @param nmtoken string to check
* @return true if nmtoken is a valid Nmtoken
*/
public static boolean isXML11ValidNmtoken(String nmtoken) {
int length = nmtoken.length();
if (length == 0)
return false;
for (int i = 0; i < length; ++i ) {
char ch = nmtoken.charAt(i);
if( !isXML11Name(ch) ) {
if ( ++i < length && isXML11NameHighSurrogate(ch) ) {
char ch2 = nmtoken.charAt(i);
if ( !XMLChar.isLowSurrogate(ch2) ||
!isXML11Name(XMLChar.supplemental(ch, ch2)) ) {
return false;
}
}
else {
return false;
}
}
}
return true;
} // isXML11ValidName(String):boolean
代码示例来源:origin: com.mobidevelop.robovm/robovm-rt
/**
* Returns true if the specified character is invalid.
*
* @param c The character to check.
*/
public static boolean isXML11Invalid(int c) {
return !isXML11Valid(c);
} // isXML11Invalid(int):boolean
代码示例来源:origin: xalan/serializer
/**
* Taken from org.apache.xerces.dom.CoreDocumentImpl
*
* Check the string against XML's definition of acceptable names for
* elements and attributes and so on using the XMLCharacterProperties
* utility class
*/
protected boolean isXMLName(String s, boolean xml11Version) {
if (s == null) {
return false;
}
if (!xml11Version)
return XMLChar.isValidName(s);
else
return XML11Char.isXML11ValidName(s);
}
代码示例来源:origin: xalan/serializer
/**
* Taken from org.apache.xerces.dom.CoreDocumentImpl
*
* Checks if the given qualified name is legal with respect
* to the version of XML to which this document must conform.
*
* @param prefix prefix of qualified name
* @param local local part of qualified name
*/
protected boolean isValidQName(
String prefix,
String local,
boolean xml11Version) {
// check that both prefix and local part match NCName
if (local == null)
return false;
boolean validNCName = false;
if (!xml11Version) {
validNCName =
(prefix == null || XMLChar.isValidNCName(prefix))
&& XMLChar.isValidNCName(local);
} else {
validNCName =
(prefix == null || XML11Char.isXML11ValidNCName(prefix))
&& XML11Char.isXML11ValidNCName(local);
}
return validNCName;
}
代码示例来源:origin: MobiVM/robovm
int i = 1;
char ch = ncName.charAt(0);
if( !isXML11NCNameStart(ch) ) {
if ( length > 1 && isXML11NameHighSurrogate(ch) ) {
char ch2 = ncName.charAt(1);
if ( !XMLChar.isLowSurrogate(ch2) ||
!isXML11NCNameStart(XMLChar.supplemental(ch, ch2)) ) {
return false;
if ( !isXML11NCName(ch) ) {
if ( ++i < length && isXML11NameHighSurrogate(ch) ) {
char ch2 = ncName.charAt(i);
if ( !XMLChar.isLowSurrogate(ch2) ||
!isXML11NCName(XMLChar.supplemental(ch, ch2)) ) {
return false;
代码示例来源:origin: com.mobidevelop.robovm/robovm-rt
int i = 1;
char ch = name.charAt(0);
if( !isXML11NameStart(ch) ) {
if ( length > 1 && isXML11NameHighSurrogate(ch) ) {
char ch2 = name.charAt(1);
if ( !XMLChar.isLowSurrogate(ch2) ||
!isXML11NameStart(XMLChar.supplemental(ch, ch2)) ) {
return false;
if ( !isXML11Name(ch) ) {
if ( ++i < length && isXML11NameHighSurrogate(ch) ) {
char ch2 = name.charAt(i);
if ( !XMLChar.isLowSurrogate(ch2) ||
!isXML11Name(XMLChar.supplemental(ch, ch2)) ) {
return false;
代码示例来源:origin: MobiVM/robovm
/**
* Check to see if a string is a valid Nmtoken according to [7]
* in the XML 1.1 Recommendation
*
* @param nmtoken string to check
* @return true if nmtoken is a valid Nmtoken
*/
public static boolean isXML11ValidNmtoken(String nmtoken) {
int length = nmtoken.length();
if (length == 0)
return false;
for (int i = 0; i < length; ++i ) {
char ch = nmtoken.charAt(i);
if( !isXML11Name(ch) ) {
if ( ++i < length && isXML11NameHighSurrogate(ch) ) {
char ch2 = nmtoken.charAt(i);
if ( !XMLChar.isLowSurrogate(ch2) ||
!isXML11Name(XMLChar.supplemental(ch, ch2)) ) {
return false;
}
}
else {
return false;
}
}
}
return true;
} // isXML11ValidName(String):boolean
代码示例来源:origin: robovm/robovm
if (XML11Char.isXML11Invalid(dataarray[i++])) {
代码示例来源:origin: ibinti/bugvm
/**
* Returns true if the specified character is invalid.
*
* @param c The character to check.
*/
public static boolean isXML11Invalid(int c) {
return !isXML11Valid(c);
} // isXML11Invalid(int):boolean
代码示例来源:origin: MobiVM/robovm
/**
* Taken from org.apache.xerces.dom.CoreDocumentImpl
*
* Check the string against XML's definition of acceptable names for
* elements and attributes and so on using the XMLCharacterProperties
* utility class
*/
protected boolean isXMLName(String s, boolean xml11Version) {
if (s == null) {
return false;
}
if (!xml11Version)
return XMLChar.isValidName(s);
else
return XML11Char.isXML11ValidName(s);
}
代码示例来源:origin: MobiVM/robovm
/**
* Taken from org.apache.xerces.dom.CoreDocumentImpl
*
* Checks if the given qualified name is legal with respect
* to the version of XML to which this document must conform.
*
* @param prefix prefix of qualified name
* @param local local part of qualified name
*/
protected boolean isValidQName(
String prefix,
String local,
boolean xml11Version) {
// check that both prefix and local part match NCName
if (local == null)
return false;
boolean validNCName = false;
if (!xml11Version) {
validNCName =
(prefix == null || XMLChar.isValidNCName(prefix))
&& XMLChar.isValidNCName(local);
} else {
validNCName =
(prefix == null || XML11Char.isXML11ValidNCName(prefix))
&& XML11Char.isXML11ValidNCName(local);
}
return validNCName;
}
代码示例来源:origin: ibinti/bugvm
int i = 1;
char ch = ncName.charAt(0);
if( !isXML11NCNameStart(ch) ) {
if ( length > 1 && isXML11NameHighSurrogate(ch) ) {
char ch2 = ncName.charAt(1);
if ( !XMLChar.isLowSurrogate(ch2) ||
!isXML11NCNameStart(XMLChar.supplemental(ch, ch2)) ) {
return false;
if ( !isXML11NCName(ch) ) {
if ( ++i < length && isXML11NameHighSurrogate(ch) ) {
char ch2 = ncName.charAt(i);
if ( !XMLChar.isLowSurrogate(ch2) ||
!isXML11NCName(XMLChar.supplemental(ch, ch2)) ) {
return false;
代码示例来源:origin: com.gluonhq/robovm-rt
int i = 1;
char ch = name.charAt(0);
if( !isXML11NameStart(ch) ) {
if ( length > 1 && isXML11NameHighSurrogate(ch) ) {
char ch2 = name.charAt(1);
if ( !XMLChar.isLowSurrogate(ch2) ||
!isXML11NameStart(XMLChar.supplemental(ch, ch2)) ) {
return false;
if ( !isXML11Name(ch) ) {
if ( ++i < length && isXML11NameHighSurrogate(ch) ) {
char ch2 = name.charAt(i);
if ( !XMLChar.isLowSurrogate(ch2) ||
!isXML11Name(XMLChar.supplemental(ch, ch2)) ) {
return false;
内容来源于网络,如有侵权,请联系作者删除!