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

x33g5p2x  于2022-02-03 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(105)

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

XMLElement.consumeRequiredAttribute介绍

[英]Consumes the given required attribute as a literal or field reference. The types parameters are required to determine how the value is parsed and validated.
[中]将给定的必需属性用作文本或字段引用。类型参数是确定如何解析和验证值所必需的。

代码示例

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

/**
 * Convenience method for parsing the named required attribute as a double
 * value or reference.
 * 
 * @return a double literal, an expression that will evaluate to a double
 *         value in the generated code
 * 
 * @throws UnableToCompleteException on unparseable value, or if the attribute
 *           is empty or unspecified
 */
public String consumeRequiredDoubleAttribute(String name) throws UnableToCompleteException {
 return consumeRequiredAttribute(name, getDoubleType());
}

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

/**
 * Convenience method for parsing the named required attribute as a integer
 * value or reference.
 * 
 * @return a integer literal, an expression that will evaluate to a integer
 *         value in the generated code
 * 
 * @throws UnableToCompleteException on unparseable value, or if the attribute
 *           is empty or unspecified
 */
public String consumeRequiredIntAttribute(String name) throws UnableToCompleteException {
 return consumeRequiredAttribute(name, getIntType());
}

代码示例来源:origin: laaglu/lib-gwt-svg

/**
 * Convenience method for parsing the named required attribute as a double
 * value or reference.
 * 
 * @return a double literal, an expression that will evaluate to a double
 *         value in the generated code
 * 
 * @throws UnableToCompleteException on unparseable value, or if the attribute
 *           is empty or unspecified
 */
public String consumeRequiredDoubleAttribute(String name) throws UnableToCompleteException {
 return consumeRequiredAttribute(name, getDoubleType());
}

代码示例来源:origin: net.wetheinter/gwt-user

/**
 * Convenience method for parsing the named required attribute as a double
 * value or reference.
 * 
 * @return a double literal, an expression that will evaluate to a double
 *         value in the generated code
 * 
 * @throws UnableToCompleteException on unparseable value, or if the attribute
 *           is empty or unspecified
 */
public String consumeRequiredDoubleAttribute(String name) throws UnableToCompleteException {
 return consumeRequiredAttribute(name, getDoubleType());
}

代码示例来源:origin: org.vectomatic/lib-gwt-svg

/**
 * Convenience method for parsing the named required attribute as a double
 * value or reference.
 * 
 * @return a double literal, an expression that will evaluate to a double
 *         value in the generated code
 * 
 * @throws UnableToCompleteException on unparseable value, or if the attribute
 *           is empty or unspecified
 */
public String consumeRequiredDoubleAttribute(String name) throws UnableToCompleteException {
 return consumeRequiredAttribute(name, getDoubleType());
}

代码示例来源:origin: org.vectomatic/lib-gwt-svg

/**
 * Convenience method for parsing the named required attribute as a integer
 * value or reference.
 * 
 * @return a integer literal, an expression that will evaluate to a integer
 *         value in the generated code
 * 
 * @throws UnableToCompleteException on unparseable value, or if the attribute
 *           is empty or unspecified
 */
public String consumeRequiredIntAttribute(String name) throws UnableToCompleteException {
 return consumeRequiredAttribute(name, getIntType());
}

代码示例来源:origin: net.wetheinter/gwt-user

/**
 * Convenience method for parsing the named required attribute as a integer
 * value or reference.
 * 
 * @return a integer literal, an expression that will evaluate to a integer
 *         value in the generated code
 * 
 * @throws UnableToCompleteException on unparseable value, or if the attribute
 *           is empty or unspecified
 */
public String consumeRequiredIntAttribute(String name) throws UnableToCompleteException {
 return consumeRequiredAttribute(name, getIntType());
}

代码示例来源:origin: laaglu/lib-gwt-svg

/**
 * Convenience method for parsing the named required attribute as a integer
 * value or reference.
 * 
 * @return a integer literal, an expression that will evaluate to a integer
 *         value in the generated code
 * 
 * @throws UnableToCompleteException on unparseable value, or if the attribute
 *           is empty or unspecified
 */
public String consumeRequiredIntAttribute(String name) throws UnableToCompleteException {
 return consumeRequiredAttribute(name, getIntType());
}

代码示例来源:origin: com.jhickman/gxt-uibinder

private String parseChildElement(XMLElement elem, JClassType valueType, UiBinderWriter writer) throws UnableToCompleteException {
    if ("value".equals(elem.getLocalName())) {
      return String.format("\"%s\"", elem.consumeInnerTextEscapedAsHtmlStringLiteral(new TextInterpreter(writer)));
    } else if ("item".equals(elem.getLocalName())) {
      return elem.consumeRequiredAttribute("value", valueType);
    }
    
    writer.die(elem, "Unknown child element of SimpleComboBox");
    
    return null; // will never get here
  }
}

代码示例来源:origin: com.jhickman/gxt-uibinder

/**
 * FIXME - only works for String value's
 * 
 * @param elem
 * @param fieldName
 * @param writer
 */
private void consumeDataChildren(XMLElement elem, String fieldName, UiBinderWriter writer) throws UnableToCompleteException {
  Interpreter<Boolean> interpreter = new SimpleInterpreter(elem.getNamespaceUri(), "data");
  JClassType stringType = writer.getOracle().findType("java.lang.String");
  
  for(XMLElement child : elem.consumeChildElements(interpreter)) {
    String key = child.consumeRequiredAttribute("key", stringType);
    String value = child.consumeRequiredAttribute("value", stringType);
    
    writer.addStatement("%s.setData(%s, %s);", fieldName, key, value);
  }
}

代码示例来源:origin: com.jhickman/gxt-uibinder

public void parse(XMLElement elem, String fieldName, JClassType type, UiBinderWriter writer) throws UnableToCompleteException {
    JClassType treePanelType = writer.getOracle().findType(GxtClassnameConstants.TREEPANEL);

    JClassType treeStoreType = writer.getOracle().findType(GxtClassnameConstants.TREESTORE);
    String store = elem.consumeRequiredAttribute("store", treeStoreType);
    
    writer.setFieldInitializerAsConstructor(fieldName, treePanelType, store);
  }
}

代码示例来源:origin: com.jhickman/gxt-uibinder

String columnCountAttribute = elem.consumeRequiredAttribute("numColumns", integerType);
Integer columnCount = Integer.valueOf(columnCountAttribute);

相关文章

XMLElement类方法