javax.faces.view.facelets.Tag类的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(8.3k)|赞(0)|评价(0)|浏览(207)

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

Tag介绍

[英]The runtime must create an instance of this class for each element in the Facelets XHTML view. A TagConfig subinterface instance is responsible for providing an instance of Tag to the TagHandler instance that is passed the TagConfig in its constructor.
[中]运行时必须为Facelets XHTML视图中的每个元素创建此类的实例。TagConfig子接口实例负责向TagHandler实例提供一个Tag实例,该实例在其构造函数中传递TagConfig

代码示例

代码示例来源:origin: javax/javaee-web-api

/**
 * Constructor.
 *
 * @param orig the original tag.
 * @param attributes the tag attributes.
 */
public Tag(Tag orig, TagAttributes attributes) {
  this(orig.getLocation(), orig.getNamespace(), orig.getLocalName(), orig
      .getQName(), attributes);
}

代码示例来源:origin: de.beyondjava/angularFaces-core

private Tag convertToACBodyTag(Tag tag, TagAttributes attributeList) {
  Tag t = new Tag(tag.getLocation(), ANGULAR_FACES_CORE_NAMESPACE, tag.getLocalName(), tag.getQName(),
      attributeList);
  return t;
}

代码示例来源:origin: javax/javaee-web-api

/**
 * <p class="changed_added_2_0">Wrap the argument <code>tag</code>
 * so the exception can reference its information.</p>
 * @param tag the <code>Tag</code> that caused this exception.
 */
public TagException(Tag tag) {
  super(tag.toString());
}

代码示例来源:origin: com.sun.faces/jsf-impl

public static void copyPassthroughAttributes(FaceletContext ctx, UIComponent c, Tag t) {
  
  if (null == c || null == t) {
    return;
  }
  
  TagAttribute[] passthroughAttrs = t.getAttributes().getAll(PassThroughAttributeLibrary.Namespace);
  if (null != passthroughAttrs && 0 < passthroughAttrs.length) {
    Map<String, Object> componentPassthroughAttrs = c.getPassThroughAttributes(true);
    Object attrValue = null;
    for (TagAttribute cur : passthroughAttrs) {
      attrValue = (cur.isLiteral()) ? cur.getValue(ctx) : cur.getValueExpression(ctx, Object.class);
      componentPassthroughAttrs.put(cur.getLocalName(), attrValue);
    }
  }
}

代码示例来源:origin: org.apache.myfaces.core/myfaces-api

private static String print(Tag tag, TagAttribute attr)
  {
    return tag.getLocation() + " <" + tag.getQName() + " " + attr.getQName() + "=\"" + attr.getValue() + "\">";
  }
}

代码示例来源:origin: TheCoder4eu/BootsFaces-OSP

private Tag convertBootsFacesTag(Tag tag) {
    if (HTML_NAMESPACE.equals(tag.getNamespace())) {
      String tagname = tag.getLocalName();
      if (bootsfacesTags.containsKey(tagname)) {
        AFTagAttributes modifiedAttributes = new AFTagAttributes(tag.getAttributes().getAll());
        Tag t = new Tag(tag.getLocation(), BOOTSFACES_NAMESPACE, tag.getLocalName(), tag.getQName(),
            modifiedAttributes);
        return t;
      }
    }
    return tag;

  }
}

代码示例来源:origin: com.sun.faces/jsf-impl

protected Tag convertTag(Tag tag, Namespace namespace, String localName) {
  Location location = tag.getLocation();
  String ns = namespace.uri;
  String qName = namespace.name() + ":" + localName;
  TagAttributes attributes = convertAttributes(tag.getAttributes());
  Tag converted = new Tag(location, ns, localName, qName, attributes);
  for (TagAttribute tagAttribute : attributes.getAll()) {
    // set the correct tag
    tagAttribute.setTag(converted);
  }
  return converted;
}

代码示例来源:origin: com.sun.faces/jsf-impl

private Tag trimJSFCAttribute(Tag tag) {
  TagAttribute attr = tag.getAttributes().get("jsfc");
  if (attr != null) {
    TagAttribute[] oa = tag.getAttributes().getAll();
    TagAttribute[] na = new TagAttribute[oa.length - 1];
    int p = 0;
    for (int i = 0; i < oa.length; i++) {
      if (!"jsfc".equals(oa[i].getLocalName())) {
        na[p++] = oa[i];
      }
    }
    return new Tag(tag, new TagAttributesImpl(na));
  }
  return tag;
}

代码示例来源:origin: TheCoder4eu/BootsFaces-OSP

private boolean containsAdvancesSearchExpression(Tag tag, String attribute) {
  boolean changeIt=false;
  TagAttribute forAttribute = tag.getAttributes().get(attribute);
  if (null != forAttribute) {
    String value = forAttribute.getValue();
    if (value.contains("*"))
      changeIt=true;
    if (value.contains("@"))
      changeIt=true;
    if (value.equals("@form") || value.equals("@none") || value.equals("@this") || value.equals("@all"))
      changeIt=false;
    if (value.startsWith("#{"))
      changeIt=false;
  }
  return changeIt;
}

代码示例来源:origin: TheCoder4eu/BootsFaces-OSP

private Tag convertToSelectOneMenuTag(Tag tag, TagAttributes attributeList) {
  TagAttribute[] attributes = attributeList.getAll();
  TagAttributes more = new AFTagAttributes(attributes);
  Tag t = new Tag(tag.getLocation(), BOOTSFACES_NAMESPACE, "selectOneMenu", "b:selectOneMenu", more);
  return t;
}

代码示例来源:origin: de.beyondjava/angularFaces-core

private Tag generatePuiHtmlTag(Tag tag, TagAttributes modifiedAttributes, final String htmlTag) {
  String keys = "";
  TagAttribute[] all = modifiedAttributes.getAll();
  for (int i = 0; i < all.length; i++) {
    TagAttribute attr = all[i];
    keys += attr.getLocalName() + ",";
    all[i] = TagAttributeUtilities.createTagAttribute(attr.getLocation(), PASS_THROUGH_NAMESPACE, attr.getLocalName(),
        attr.getQName(), attr.getValue());
  }
  if (keys.endsWith(","))
    keys = keys.substring(0, keys.length() - 1);
  ((AFTagAttributes) modifiedAttributes).addAttribute(tag.getLocation(), ANGULAR_FACES_CORE_NAMESPACE, "attributeNames",
      "attributeNames", keys);
  return new Tag(tag.getLocation(), ANGULAR_FACES_CORE_NAMESPACE, htmlTag, htmlTag, modifiedAttributes);
}

代码示例来源:origin: javax/javaee-web-api

/**
 * Utility method for fetching the appropriate TagAttribute
 * 
 * @param localName
 *            name of attribute
 * @return TagAttribute if found, otherwise null
 */
protected final TagAttribute getAttribute(String localName) {
  return this.tag.getAttributes().get(localName);
}

代码示例来源:origin: com.sun.faces/jsf-impl

private TagAttribute createElementName(Tag tag) {
  Location location = tag.getLocation();
  String ns = Namespace.p.uri;
  String myLocalName = Renderer.PASSTHROUGH_RENDERER_LOCALNAME_KEY;
  String qName = "p:" + myLocalName;
  String value = tag.getLocalName();
  return new TagAttributeImpl(location, ns, myLocalName, qName, value);
}

代码示例来源:origin: org.apache.myfaces.core/myfaces-shaded-impl

public MetaRulesetImpl(Tag tag, Class<?> type)
{
  _tag = tag;
  _type = type;
  _attributes = new HashMap<String, TagAttribute>();
  _mappers = new ArrayList<Metadata>();
  _rules = new ArrayList<MetaRule>();
  // setup attributes
  for (TagAttribute attribute : _tag.getAttributes().getAll())
  {
    _attributes.put(attribute.getLocalName(), attribute);
  }
  // add default rules
  _rules.add(BeanPropertyTagRule.Instance);
}

代码示例来源:origin: de.beyondjava/angularFaces-core

private Tag convertToPuiMessagesTag(Tag tag, TagAttributes attributeList) {
  if (tag.getNamespace().equals(PRIMEFACES_NAMESPACE)) {
    AFTagAttributes modifiedAttributes = new AFTagAttributes(attributeList.getAll());
    modifiedAttributes.addAttribute(tag.getLocation(), PASS_THROUGH_NAMESPACE, "primefaces", "primefaces", "true");
    Tag t = new Tag(tag.getLocation(), HTML_NAMESPACE, "puimessages", "puimessages", modifiedAttributes);
    return t;
  } else {
    Tag t = new Tag(tag.getLocation(), HTML_NAMESPACE, "puimessages", "puimessages", attributeList);
    return t;
  }
}

代码示例来源:origin: org.apache.myfaces.core/myfaces-impl

@Override
protected MetaRuleset createMetaRuleset(Class type)
{
  MetaRuleset meta = super.createMetaRuleset(type);
  if (!UILibrary.NAMESPACE.equals(this.tag.getNamespace()) &&
    !UILibrary.ALIAS_NAMESPACE.equals(this.tag.getNamespace()))
  {
    meta.add(new TagMetaData(type));
  }
  meta.alias("class", "styleClass");
  return meta;
}

代码示例来源:origin: org.glassfish/javax.faces

private boolean hasJsfAttribute(Tag tag) {
  for (String ns : tag.getAttributes().getNamespaces()) {
    if (Namespace.jsf.uri.equals(ns)) {
      return true;
    }
  }
  return false;
}

代码示例来源:origin: com.sun.faces/jsf-impl

private String getPrefixFromTag(Tag t) {
  String result = t.getQName();
  if (null != result) {
    int i;
    if (-1 != (i = result.indexOf(":"))) {
      result = result.substring(0, i);
    }
  }
  return result;
}

代码示例来源:origin: stackoverflow.com

CreateTagsRequest createTagsRequest = new CreateTagsRequest();
  .withTags(new Tag("Name", "travel-ecommerce-" + idx));
ec2.createTags(createTagsRequest);

代码示例来源:origin: org.glassfish/jakarta.faces

public static void copyPassthroughAttributes(FaceletContext ctx, UIComponent c, Tag t) {
  
  if (null == c || null == t) {
    return;
  }
  
  TagAttribute[] passthroughAttrs = t.getAttributes().getAll(PassThroughAttributeLibrary.Namespace);
  if (null != passthroughAttrs && 0 < passthroughAttrs.length) {
    Map<String, Object> componentPassthroughAttrs = c.getPassThroughAttributes(true);
    Object attrValue = null;
    for (TagAttribute cur : passthroughAttrs) {
      attrValue = (cur.isLiteral()) ? cur.getValue(ctx) : cur.getValueExpression(ctx, Object.class);
      componentPassthroughAttrs.put(cur.getLocalName(), attrValue);
    }
  }
}

相关文章