本文整理匯總了Java中org.waveprotocol.wave.model.util.Utf16Util.isXmlName方法的典型用法代碼示例。如果您正苦於以下問題:Java Utf16Util.isXmlName方法的具體用法?Java Utf16Util.isXmlName怎麽用?Java Utf16Util.isXmlName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.waveprotocol.wave.model.util.Utf16Util
的用法示例。
在下文中一共展示了Utf16Util.isXmlName方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: checkAttributesUpdateWellFormed
import org.waveprotocol.wave.model.util.Utf16Util; //導入方法依賴的package包/類
private ValidationResult checkAttributesUpdateWellFormed(AttributesUpdate u,
ViolationCollector v) {
if (u == null) { return nullAttributesUpdate(v); }
String previousKey = null;
for (int i = 0; i < u.changeSize(); i++) {
String key = u.getChangeKey(i);
if (key == null) { return nullAttributeKey(v); }
if (!Utf16Util.isXmlName(key)) { return attributeNameNotXmlName(v, key); }
if (previousKey != null && previousKey.compareTo(key) >= 0) {
return attributeKeysNotStrictlyMonotonic(v, previousKey, key);
}
if (u.getOldValue(i) != null && !Utf16Util.isValidUtf16(u.getOldValue(i))) {
return attributeValueNotValidUtf16(v);
}
if (u.getNewValue(i) != null && !Utf16Util.isValidUtf16(u.getNewValue(i))) {
return attributeValueNotValidUtf16(v);
}
previousKey = key;
}
return ValidationResult.VALID;
}
示例2: checkAttributesWellFormed
import org.waveprotocol.wave.model.util.Utf16Util; //導入方法依賴的package包/類
private ValidationResult checkAttributesWellFormed(Attributes attr, ViolationCollector v) {
if (attr == null) { return nullAttributes(v); }
String previousKey = null;
for (Map.Entry<String, String> e : attr.entrySet()) {
if (e.getKey() == null) { return nullAttributeKey(v); }
if (!Utf16Util.isXmlName(e.getKey())) { return attributeNameNotXmlName(v, e.getKey()); }
if (e.getValue() == null) { return nullAttributeValue(v); }
if (!Utf16Util.isValidUtf16(e.getValue())) { return attributeValueNotValidUtf16(v); }
if (previousKey != null && previousKey.compareTo(e.getKey()) >= 0) {
return attributeKeysNotStrictlyMonotonic(v, previousKey, e.getKey());
}
previousKey = e.getKey();
}
return ValidationResult.VALID;
}
示例3: checkElementType
import org.waveprotocol.wave.model.util.Utf16Util; //導入方法依賴的package包/類
private static void checkElementType(String name) throws InvalidSchemaException {
if (!Utf16Util.isXmlName(name)) {
throw new InvalidSchemaException("Invalid element type: " + name);
}
}
示例4: checkAttributeName
import org.waveprotocol.wave.model.util.Utf16Util; //導入方法依賴的package包/類
private static void checkAttributeName(String name) throws InvalidSchemaException {
if (!Utf16Util.isXmlName(name)) {
throw new InvalidSchemaException("Invalid attribute name: " + name);
}
}
示例5: checkValidTagName
import org.waveprotocol.wave.model.util.Utf16Util; //導入方法依賴的package包/類
private void checkValidTagName(String tagName) {
if (!Utf16Util.isXmlName(tagName)) {
Preconditions.illegalArgument("Invalid tag name: '" + tagName + "'");
}
}
示例6: checkValidAttributeName
import org.waveprotocol.wave.model.util.Utf16Util; //導入方法依賴的package包/類
private void checkValidAttributeName(String tagName) {
if (!Utf16Util.isXmlName(tagName)) {
Preconditions.illegalArgument("Invalid attribute name: '" + tagName + "'");
}
}