gpt4 book ai didi

com.google.gwt.uibinder.rebind.XMLElement.consumeRawArrayAttribute()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-21 08:23:05 25 4
gpt4 key购买 nike

本文整理了Java中com.google.gwt.uibinder.rebind.XMLElement.consumeRawArrayAttribute()方法的一些代码示例,展示了XMLElement.consumeRawArrayAttribute()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLElement.consumeRawArrayAttribute()方法的具体详情如下:
包路径:com.google.gwt.uibinder.rebind.XMLElement
类名称:XMLElement
方法名:consumeRawArrayAttribute

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;
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com