/** * 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()); }
/** * 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()); }
/** * 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()); }
/** * 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()); }
/** * 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()); }
/** * 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()); }
/** * 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()); }
/** * 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()); }
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 } }
/** * 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); } }
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); } }
String columnCountAttribute = elem.consumeRequiredAttribute("numColumns", integerType); Integer columnCount = Integer.valueOf(columnCountAttribute);