gpt4 book ai didi

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

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

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

XMLElement.getAttributeCount介绍

[英]Returns the number of attributes this element has.
[中]返回此元素具有的属性数。

代码示例

代码示例来源:origin: com.google.gwt/gwt-servlet

public String interpretElement(XMLElement elem)
   throws UnableToCompleteException {
  Map<String, String> attNameToToken = new HashMap<String, String>();

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

   if (att.hasComputedValue()) {
    String attToken = delegate.getAttributeToken(att);
    attNameToToken.put(att.getName(), attToken);
   } else {
    /*
     * No computed value, but make sure that any {{ madness gets escaped.
     * TODO(rjrjr) Move this to XMLElement RSN
     */
    String n = att.getName();
    String v = att.consumeRawValue().replace("\\{", "{");
    elem.setAttribute(n, v);
   }
  }

  for (Map.Entry<String, String> attr : attNameToToken.entrySet()) {
   elem.setAttribute(attr.getKey(), attr.getValue());
  }

  // Return null because we don't want to replace the dom element
  return null;
 }
}

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
  * An element will require a placeholder if the user has called it out with a
  * ui:ph attribute, or if it will require run time swizzling (e.g. has a
  * ui:field). These latter we can identify easily because they'll have an
  * attribute that holds a tokenator token that was vended by
  * {@link UiBinderWriter}, typically in id.
  *
  * @return true if it has an ui:ph attribute, or has a token in any attribute
  */
 private boolean isDomPlaceholder(XMLElement elem) {
  MessagesWriter mw = uiWriter.getMessages();
  if (mw.hasMessageAttribute("ph", elem)) {
   return true;
  }
  for (int i = elem.getAttributeCount() - 1; i >= 0; i--) {
   if (elem.getAttribute(i).hasToken()) {
    return true;
   }
  }
  return false;
 }
}

代码示例来源:origin: com.google.gwt/gwt-servlet

for (int i = elem.getAttributeCount() - 1; i >= 0; i--) {

代码示例来源:origin: com.google.gwt/gwt-servlet

if (element.getAttributeCount() > 0) {
 writer.die(element, "Unexpected attributes");

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

/**
 * Ensure that the receiver has no attributes left.
 * 
 * @throws UnableToCompleteException if it does
 */
public void assertNoAttributes() throws UnableToCompleteException {
 int numAtts = getAttributeCount();
 if (numAtts == 0) {
  return;
 }
 StringBuilder b = new StringBuilder();
 for (int i = 0; i < numAtts; i++) {
  if (i > 0) {
   b.append(", ");
  }
  b.append('"').append(getAttribute(i).getName()).append('"');
 }
 logger.die(this, "Unexpected attributes: %s", b);
}

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

/**
 * Ensure that the receiver has no attributes left.
 * 
 * @throws UnableToCompleteException if it does
 */
public void assertNoAttributes() throws UnableToCompleteException {
 int numAtts = getAttributeCount();
 if (numAtts == 0) {
  return;
 }
 StringBuilder b = new StringBuilder();
 for (int i = 0; i < numAtts; i++) {
  if (i > 0) {
   b.append(", ");
  }
  b.append('"').append(getAttribute(i).getName()).append('"');
 }
 logger.die(this, "Unexpected attributes: %s", b);
}

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

/**
 * Ensure that the receiver has no attributes left.
 * 
 * @throws UnableToCompleteException if it does
 */
public void assertNoAttributes() throws UnableToCompleteException {
 int numAtts = getAttributeCount();
 if (numAtts == 0) {
  return;
 }
 StringBuilder b = new StringBuilder();
 for (int i = 0; i < numAtts; i++) {
  if (i > 0) {
   b.append(", ");
  }
  b.append('"').append(getAttribute(i).getName()).append('"');
 }
 logger.die(this, "Unexpected attributes: %s", b);
}

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

/**
 * Ensure that the receiver has no attributes left.
 * 
 * @throws UnableToCompleteException if it does
 */
public void assertNoAttributes() throws UnableToCompleteException {
 int numAtts = getAttributeCount();
 if (numAtts == 0) {
  return;
 }
 StringBuilder b = new StringBuilder();
 for (int i = 0; i < numAtts; i++) {
  if (i > 0) {
   b.append(", ");
  }
  b.append('"').append(getAttribute(i).getName()).append('"');
 }
 logger.die(this, "Unexpected attributes: %s", b);
}

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

/**
 * Consumes all attributes, and returns a string representing the entire
 * opening tag. E.g., "<div able='baker'>"
 */
public String consumeOpeningTag() {
 String rtn = getOpeningTag();
 for (int i = getAttributeCount() - 1; i >= 0; i--) {
  getAttribute(i).consumeRawValue();
 }
 return rtn;
}

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

/**
 * Consumes all attributes, and returns a string representing the entire
 * opening tag. E.g., "<div able='baker'>"
 */
public String consumeOpeningTag() {
 String rtn = getOpeningTag();
 for (int i = getAttributeCount() - 1; i >= 0; i--) {
  getAttribute(i).consumeRawValue();
 }
 return rtn;
}

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

/**
 * Consumes all attributes, and returns a string representing the entire
 * opening tag. E.g., "<div able='baker'>"
 */
public String consumeOpeningTag() {
 String rtn = getOpeningTag();
 for (int i = getAttributeCount() - 1; i >= 0; i--) {
  getAttribute(i).consumeRawValue();
 }
 return rtn;
}

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

/**
 * Consumes all attributes, and returns a string representing the entire
 * opening tag. E.g., "<div able='baker'>"
 */
public String consumeOpeningTag() {
 String rtn = getOpeningTag();
 for (int i = getAttributeCount() - 1; i >= 0; i--) {
  getAttribute(i).consumeRawValue();
 }
 return rtn;
}

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

public String interpretElement(XMLElement elem)
   throws UnableToCompleteException {
  Map<String, String> attNameToToken = new HashMap<String, String>();

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

   if (att.hasComputedValue()) {
    String attToken = delegate.getAttributeToken(att);
    attNameToToken.put(att.getName(), attToken);
   } else {
    /*
     * No computed value, but make sure that any {{ madness gets escaped.
     * TODO(rjrjr) Move this to XMLElement RSN
     */
    String n = att.getName();
    String v = att.consumeRawValue().replace("{{", "{");
    elem.setAttribute(n, v);
   }
  }

  for (Map.Entry<String, String> attr : attNameToToken.entrySet()) {
   elem.setAttribute(attr.getKey(), attr.getValue());
  }

  // Return null because we don't want to replace the dom element
  return null;
 }
}

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

public String interpretElement(XMLElement elem)
   throws UnableToCompleteException {
  Map<String, String> attNameToToken = new HashMap<String, String>();

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

   if (att.hasComputedValue()) {
    String attToken = delegate.getAttributeToken(att);
    attNameToToken.put(att.getName(), attToken);
   } else {
    /*
     * No computed value, but make sure that any {{ madness gets escaped.
     * TODO(rjrjr) Move this to XMLElement RSN
     */
    String n = att.getName();
    String v = att.consumeRawValue().replace("\\{", "{");
    elem.setAttribute(n, v);
   }
  }

  for (Map.Entry<String, String> attr : attNameToToken.entrySet()) {
   elem.setAttribute(attr.getKey(), attr.getValue());
  }

  // Return null because we don't want to replace the dom element
  return null;
 }
}

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

if (child.hasChildNodes() || child.getAttributeCount() > 0) {
 logger.die(this, "Illegal child %s in a text-only context. "
   + "Perhaps you are trying to use unescaped HTML "

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

protected void applyColumnConfigProperties(UiBinderWriter writer,
    Map<String, JType> columnConfigSetterTypes, XMLElement child,
    String columnConfig) throws UnableToCompleteException {
  
  int attributeCount = child.getAttributeCount();
  for(int i = 0; i < attributeCount; i++) {
    // always get 0 because we're consuming them
    XMLAttribute attribute = child.getAttribute(0);
    String setterMethod = "set" + initialCap(attribute.getName());
    String value = child.consumeAttribute(attribute.getName(), columnConfigSetterTypes.get(setterMethod));
    writer.addStatement("%s.%s(%s);", columnConfig, setterMethod, value);
  }
}

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

/**
  * An element will require a placeholder if the user has called it out with a
  * ui:ph attribute, or if it will require run time swizzling (e.g. has a
  * ui:field). These latter we can identify easily because they'll have an
  * attribute that holds a tokenator token that was vended by
  * {@link UiBinderWriter}, typically in id.
  *
  * @return true if it has an ui:ph attribute, or has a token in any attribute
  */
 private boolean isDomPlaceholder(XMLElement elem) {
  MessagesWriter mw = uiWriter.getMessages();
  if (mw.hasMessageAttribute("ph", elem)) {
   return true;
  }
  for (int i = elem.getAttributeCount() - 1; i >= 0; i--) {
   if (elem.getAttribute(i).hasToken()) {
    return true;
   }
  }
  return false;
 }
}

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

/**
  * An element will require a placeholder if the user has called it out with a
  * ui:ph attribute, or if it will require run time swizzling (e.g. has a
  * ui:field). These latter we can identify easily because they'll have an
  * attribute that holds a tokenator token that was vended by
  * {@link UiBinderWriter}, typically in id.
  *
  * @return true if it has an ui:ph attribute, or has a token in any attribute
  */
 private boolean isDomPlaceholder(XMLElement elem) {
  MessagesWriter mw = uiWriter.getMessages();
  if (mw.hasMessageAttribute("ph", elem)) {
   return true;
  }
  for (int i = elem.getAttributeCount() - 1; i >= 0; i--) {
   if (elem.getAttribute(i).hasToken()) {
    return true;
   }
  }
  return false;
 }
}

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

if (elem.getAttributeCount() > 0) {
 writer.die(elem, "Should only find attribute \"%s\"", FIELD_ATTRIBUTE);

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

if (element.getAttributeCount() > 0) {
 writer.die(element, "Unexpected attributes");

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