本文整理了Java中com.google.gwt.uibinder.rebind.XMLElement.consumeRawArrayAttribute()
方法的一些代码示例,展示了XMLElement.consumeRawArrayAttribute()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLElement.consumeRawArrayAttribute()
方法的具体详情如下:
包路径:com.google.gwt.uibinder.rebind.XMLElement
类名称:XMLElement
方法名:consumeRawArrayAttribute
[英]Consumes the named attribute and parses it to an unparsed, unescaped array of Strings. The strings in the attribute may be comma or space separated (or a mix of both).
[中]使用命名的属性,并将其解析为未经分析的、未转换的字符串数组。属性中的字符串可以是逗号分隔的或空格分隔的(或两者的混合)。
代码示例来源:origin: com.jhickman/gxt-uibinder
public static String parseAttributeWithArrayConstructor(XMLElement elem, String attributeName, String typeName, UiBinderWriter writer) throws UnableToCompleteException {
String[] arrayData = elem.consumeRawArrayAttribute(attributeName);
if (arrayData != null && arrayData.length > 0) {
JClassType type = writer.getOracle().findType(typeName);
String fieldName = writer.declareField(typeName, elem);
writer.setFieldInitializerAsConstructor(fieldName, type, arrayData);
return fieldName;
}
return null;
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
/**
* Consumes the named attribute and parses it to an array of String
* expressions. The strings in the attribute may be comma or space separated
* (or a mix of both).
*
* @return array of String expressions, empty if the attribute was not set.
* @throws UnableToCompleteException on unparseable value
*/
public String[] consumeStringArrayAttribute(String name) throws UnableToCompleteException {
AttributeParser parser = attributeParsers.getParser(getStringType());
String[] strings = consumeRawArrayAttribute(name);
for (int i = 0; i < strings.length; i++) {
strings[i] = parser.parse(this, strings[i]);
}
designTime.putAttribute(this, name, strings);
return strings;
}
代码示例来源:origin: laaglu/lib-gwt-svg
/**
* Consumes the named attribute and parses it to an array of String
* expressions. The strings in the attribute may be comma or space separated
* (or a mix of both).
*
* @return array of String expressions, empty if the attribute was not set.
* @throws UnableToCompleteException on unparseable value
*/
public String[] consumeStringArrayAttribute(String name) throws UnableToCompleteException {
AttributeParser parser = attributeParsers.getParser(getStringType());
String[] strings = consumeRawArrayAttribute(name);
for (int i = 0; i < strings.length; i++) {
strings[i] = parser.parse(this, strings[i]);
}
designTime.putAttribute(this, name, strings);
return strings;
}
代码示例来源:origin: org.vectomatic/lib-gwt-svg
/**
* Consumes the named attribute and parses it to an array of String
* expressions. The strings in the attribute may be comma or space separated
* (or a mix of both).
*
* @return array of String expressions, empty if the attribute was not set.
* @throws UnableToCompleteException on unparseable value
*/
public String[] consumeStringArrayAttribute(String name) throws UnableToCompleteException {
AttributeParser parser = attributeParsers.getParser(getStringType());
String[] strings = consumeRawArrayAttribute(name);
for (int i = 0; i < strings.length; i++) {
strings[i] = parser.parse(this, strings[i]);
}
designTime.putAttribute(this, name, strings);
return strings;
}
代码示例来源:origin: net.wetheinter/gwt-user
private void createStyle(XMLElement elem) throws UnableToCompleteException {
String body = elem.consumeUnescapedInnerText();
String[] source = elem.consumeRawArrayAttribute(SOURCE_ATTRIBUTE);
if (0 == body.length() && 0 == source.length) {
writer.die(elem, "Must have either a src attribute or body text");
}
String name = elem.consumeRawAttribute(FIELD_ATTRIBUTE, "style");
JClassType publicType = consumeCssResourceType(elem);
String[] importTypeNames = elem.consumeRawArrayAttribute(IMPORT_ATTRIBUTE);
LinkedHashSet<JClassType> importTypes = new LinkedHashSet<JClassType>();
for (String type : importTypeNames) {
importTypes.add(findCssResourceType(elem, type));
}
Boolean gss = elem.consumeBooleanConstantAttribute(GSS_ATTRIBUTE);
ImplicitCssResource cssMethod = bundleClass.createCssResource(name, source,
publicType, body, importTypes, gss, resourceOracle);
FieldWriter field = fieldManager.registerFieldForGeneratedCssResource(cssMethod);
field.setInitializer(String.format("%s.%s()",
fieldManager.convertFieldToGetter(bundleClass.getFieldName()),
cssMethod.getName()));
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
private void createStyle(XMLElement elem) throws UnableToCompleteException {
String body = elem.consumeUnescapedInnerText();
String[] source = elem.consumeRawArrayAttribute(SOURCE_ATTRIBUTE);
if (0 == body.length() && 0 == source.length) {
writer.die(elem, "Must have either a src attribute or body text");
}
String name = elem.consumeRawAttribute(FIELD_ATTRIBUTE, "style");
JClassType publicType = consumeCssResourceType(elem);
String[] importTypeNames = elem.consumeRawArrayAttribute(IMPORT_ATTRIBUTE);
LinkedHashSet<JClassType> importTypes = new LinkedHashSet<JClassType>();
for (String type : importTypeNames) {
importTypes.add(findCssResourceType(elem, type));
}
Boolean gss = elem.consumeBooleanConstantAttribute(GSS_ATTRIBUTE);
ImplicitCssResource cssMethod = bundleClass.createCssResource(name, source,
publicType, body, importTypes, gss, resourceOracle);
FieldWriter field = fieldManager.registerFieldForGeneratedCssResource(cssMethod);
field.setInitializer(String.format("%s.%s()",
fieldManager.convertFieldToGetter(bundleClass.getFieldName()),
cssMethod.getName()));
}
代码示例来源:origin: net.wetheinter/gwt-user
/**
* Consumes the named attribute and parses it to an array of String
* expressions. The strings in the attribute may be comma or space separated
* (or a mix of both).
*
* @return array of String expressions, empty if the attribute was not set.
* @throws UnableToCompleteException on unparseable value
*/
public String[] consumeStringArrayAttribute(String name) throws UnableToCompleteException {
AttributeParser parser = attributeParsers.getParser(getStringType());
String[] strings = consumeRawArrayAttribute(name);
for (int i = 0; i < strings.length; i++) {
strings[i] = parser.parse(this, strings[i]);
}
designTime.putAttribute(this, name, strings);
return strings;
}
内容来源于网络,如有侵权,请联系作者删除!