本文整理汇总了Java中com.sun.xml.internal.fastinfoset.org.apache.xerces.util.XMLChar.isSpace方法的典型用法代码示例。如果您正苦于以下问题:Java XMLChar.isSpace方法的具体用法?Java XMLChar.isSpace怎么用?Java XMLChar.isSpace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.xml.internal.fastinfoset.org.apache.xerces.util.XMLChar
的用法示例。
在下文中一共展示了XMLChar.isSpace方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkWhiteSpace
import com.sun.xml.internal.fastinfoset.org.apache.xerces.util.XMLChar; //导入方法依赖的package包/类
private void checkWhiteSpace(){
//refer to xerces XMLChar
if(!Util.isEmptyString(_text)){
isSpace = true;
for(int i=0;i<_text.length();i++){
if(!XMLChar.isSpace(_text.charAt(i))){
isSpace = false;
break;
}
}
}
}
示例2: isWhiteSpace
import com.sun.xml.internal.fastinfoset.org.apache.xerces.util.XMLChar; //导入方法依赖的package包/类
/**
* Returns true if the cursor points to a character data event that consists of all whitespace
* Application calling this method needs to cache the value and avoid calling this method again
* for the same event.
* @return true if the cursor points to all whitespace, false otherwise
*/
public final boolean isWhiteSpace() {
if(isCharacters() || (_eventType == CDATA)){
char [] ch = this.getTextCharacters();
int start = this.getTextStart();
int length = this.getTextLength();
for (int i = start; i < start + length; i++){
if(!XMLChar.isSpace(ch[i])){
return false;
}
}
return true;
}
return false;
}
示例3: isWhiteSpace
import com.sun.xml.internal.fastinfoset.org.apache.xerces.util.XMLChar; //导入方法依赖的package包/类
/**
* Check if character array contains characters that are all white space.
*
* @param ch the character array
* @param start the starting character index into the array to check from
* @param length the number of characters to check
* @return true if all characters are white space, false otherwise
*/
public static boolean isWhiteSpace(final char[] ch, int start, final int length) {
if (!XMLChar.isSpace(ch[start])) return false;
final int end = start + length;
while(++start < end && XMLChar.isSpace(ch[start]));
return start == end;
}