本文整理了Java中com.google.gwt.uibinder.rebind.XMLElement.consumeInnerTextEscapedAsStringLiteral()
方法的一些代码示例,展示了XMLElement.consumeInnerTextEscapedAsStringLiteral()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLElement.consumeInnerTextEscapedAsStringLiteral()
方法的具体详情如下:
包路径:com.google.gwt.uibinder.rebind.XMLElement
类名称:XMLElement
方法名:consumeInnerTextEscapedAsStringLiteral
[英]Consumes all child text nodes, and asserts that this element held only text. Trailing and leading whitespace is trimmed, and escaped for use as a string literal. Notice that HTML entities in the text are NOT escaped
This call requires an interpreter to make sense of any special children. The odds are you want to use com.google.gwt.uibinder.elementparsers.TextInterpreter
[中]使用所有子文本节点,并断言此元素仅包含文本。尾随和前导空格被修剪,并转义以用作字符串文字。请注意,文本中的HTML实体不会转义
这个电话需要翻译来理解任何特殊的孩子。你很可能想使用com。谷歌。gwt。尤宾德。元素分析器。文本解释器
代码示例来源:origin: com.google.gwt/gwt-servlet
public void parse(XMLElement elem, String fieldName, JClassType type,
UiBinderWriter writer) throws UnableToCompleteException {
// Parse children.
for (XMLElement child : elem.consumeChildElements()) {
String tagName = child.getLocalName();
if (!tagName.equals(ITEM_TAG)) {
writer.die(elem, "Invalid ListBox child element: " + tagName);
}
String value = child.consumeStringAttribute("value");
String innerText = child.consumeInnerTextEscapedAsStringLiteral(
new TextInterpreter(writer));
if (value != null) {
writer.addStatement("%s.addItem(\"%s\", %s);", fieldName, innerText, value);
} else {
writer.addStatement("%s.addItem(\"%s\");", fieldName, innerText);
}
}
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
public void parse(XMLElement elem, String fieldName, JClassType type,
UiBinderWriter writer) throws UnableToCompleteException {
// Parse children.
for (XMLElement child : elem.consumeChildElements()) {
String tagName = child.getLocalName();
if (!tagName.equals(ITEM_TAG)) {
writer.die(elem, "Invalid ListBox child element: " + tagName);
}
String value = child.consumeStringAttribute("value");
String innerText = child.consumeInnerTextEscapedAsStringLiteral(
new TextInterpreter(writer));
if (value != null) {
writer.addStatement("%s.addItem(\"%s\", %s);", fieldName, innerText, value);
} else {
writer.addStatement("%s.addItem(\"%s\");", fieldName, innerText);
}
}
}
代码示例来源:origin: net.wetheinter/gwt-user
public void parse(XMLElement elem, String fieldName, JClassType type,
UiBinderWriter writer) throws UnableToCompleteException {
// Parse children.
for (XMLElement child : elem.consumeChildElements()) {
String tagName = child.getLocalName();
if (!tagName.equals(ITEM_TAG)) {
writer.die(elem, "Invalid ListBox child element: " + tagName);
}
String value = child.consumeStringAttribute("value");
String innerText = child.consumeInnerTextEscapedAsStringLiteral(
new TextInterpreter(writer));
if (value != null) {
writer.addStatement("%s.addItem(\"%s\", %s);", fieldName, innerText, value);
} else {
writer.addStatement("%s.addItem(\"%s\");", fieldName, innerText);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!