Package com.google.gwt.uibinder.attributeparsers

Examples of com.google.gwt.uibinder.attributeparsers.AttributeParser


  }

  @SuppressWarnings("deprecation")
  private AttributeParser getParser(XMLAttribute xmlAttribute, JType... types)
      throws UnableToCompleteException {
    AttributeParser rtn = bundleParsers.get(xmlAttribute);
    if (rtn == null) {
      rtn = attributeParsers.get(types);
    }

    return rtn;
View Full Code Here


        designTime.putAttribute(this, name + ".default", defaultValue);
      }
      return defaultValue;
    }
    String rawValue = attribute.consumeRawValue();
    AttributeParser parser = getParser(attribute, types);
    if (parser == null) {
      logger.die(this, "No such attribute %s", name);
    }

    try {
      String value = parser.parse(rawValue);
      designTime.putAttribute(this, name, value);
      return value;
    } catch (UnableToCompleteException e) {
      logger.die(this, "Cannot parse attribute %s", name);
      throw e;
View Full Code Here

     */
    XMLAttribute attribute = getAttribute(name);
    if (attribute == null) {
      failRequired(name);
    }
    AttributeParser parser = getParser(attribute, types);
    String rawValue = consumeRequiredRawAttribute(name);

    try {
      String value = parser.parse(rawValue);
      designTime.putAttribute(this, name, value);
      return value;
    } catch (UnableToCompleteException e) {
      logger.die(this, "Cannot parse attribute \"%s\"", name);
      throw e;
View Full Code Here

   * @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.get(getStringType());

    String[] strings = consumeRawArrayAttribute(name);
    for (int i = 0; i < strings.length; i++) {
      try {
        strings[i] = parser.parse(strings[i]);
      } catch (UnableToCompleteException e) {
        logger.die(this, "Cannot parse attribute " + name);
        throw e;
      }
    }
View Full Code Here

  }

  @SuppressWarnings("deprecation")
  private AttributeParser getParser(XMLAttribute xmlAttribute, JType... types)
      throws UnableToCompleteException {
    AttributeParser rtn = bundleParsers.get(xmlAttribute);
    if (rtn == null) {
      rtn = attributeParsers.get(types);
    }

    return rtn;
View Full Code Here

      throws UnableToCompleteException {
    Map<String, String> attNameToToken = new HashMap<String, String>();

    for (int i = elem.getAttributeCount() - 1; i >= 0; i--) {
      XMLAttribute att = elem.getAttribute(i);
      AttributeParser parser = writer.getBundleAttributeParser(att);

      if (parser != null) {
        // Legacy res:style='style.pretty'
        String parsedValue = parser.parse(att.consumeRawValue());
        String attToken = writer.tokenForStringExpression(parsedValue);

        // Use localName so <div res:style='...'> becomes <div style='...'>
        attNameToToken.put(att.getLocalName(), attToken);
        continue;
View Full Code Here

TOP

Related Classes of com.google.gwt.uibinder.attributeparsers.AttributeParser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.