Package com.sun.faces.facelets.tag

Examples of com.sun.faces.facelets.tag.TagAttributeImpl


        protected TagAttributesImpl createAttributes(Attributes attrs) {
            int len = attrs.getLength();
            TagAttributeImpl[] ta = new TagAttributeImpl[len];
            for (int i = 0; i < len; i++) {
                ta[i] = new TagAttributeImpl(this.createLocation(),
                        attrs.getURI(i), attrs.getLocalName(i), attrs
                                .getQName(i), attrs.getValue(i));
            }
            return new TagAttributesImpl(ta);
        }
View Full Code Here


        protected TagAttributes createAttributes(Attributes attrs) {
            int len = attrs.getLength();
            TagAttribute[] ta = new TagAttribute[len];
            for (int i = 0; i < len; i++) {
                ta[i] = new TagAttributeImpl(this.createLocation(),
                        attrs.getURI(i), attrs.getLocalName(i), attrs
                                .getQName(i), attrs.getValue(i));
            }
            return new TagAttributesImpl(ta);
        }
View Full Code Here

        protected TagAttributesImpl createAttributes(Attributes attrs) {
            int len = attrs.getLength();
            TagAttributeImpl[] ta = new TagAttributeImpl[len];
            for (int i = 0; i < len; i++) {
                ta[i] = new TagAttributeImpl(this.createLocation(),
                        attrs.getURI(i), attrs.getLocalName(i), attrs
                                .getQName(i), attrs.getValue(i));
            }
            return new TagAttributesImpl(ta);
        }
View Full Code Here

        protected TagAttributes createAttributes(Attributes attrs) {
            int len = attrs.getLength();
            TagAttribute[] ta = new TagAttribute[len];
            for (int i = 0; i < len; i++) {
                ta[i] = new TagAttributeImpl(this.createLocation(),
                        attrs.getURI(i), attrs.getLocalName(i), attrs
                                .getQName(i), attrs.getValue(i));
            }
            return new TagAttributesImpl(ta);
        }
View Full Code Here

        protected TagAttributes createAttributes(Attributes attrs) {
            int len = attrs.getLength();
            TagAttribute[] ta = new TagAttribute[len];
            for (int i = 0; i < len; i++) {
                ta[i] = new TagAttributeImpl(this.createLocation(),
                        attrs.getURI(i), attrs.getLocalName(i), attrs
                                .getQName(i), attrs.getValue(i));
            }
            return new TagAttributesImpl(ta);
        }
View Full Code Here

  public Tag decorate(Tag tag) {
    Location location = tag.getLocation();
    String namespace = tag.getNamespace();
    String qName = tag.getQName().toLowerCase();
    TagAttributeImpl tagNameAttr = null;
    TagAttributeImpl tagTargetAttr = null;
    List<TagAttribute> attrs = new ArrayList<TagAttribute>(Arrays.asList(tag.getAttributes().getAll()));
    Collections.sort(attrs, new Comparator<TagAttribute>() {
      public int compare(TagAttribute ta1, TagAttribute ta2) {
        return ta1.getQName().compareTo(ta2.getQName());
      }
    });
    if (StringUtils.isEmpty(namespace) && !HtmlDecorator.XhtmlNamespace.equals(namespace) && !reservedTags.contains(qName)) {
      String name = qName;
      if (headTags.contains(qName)) {
        name = "output";
        tagNameAttr = new TagAttributeImpl(location, namespace, QNAME, QNAME, qName);
        tagTargetAttr = new TagAttributeImpl(location, namespace, "target", "target", "head");
      } else if (bodyTags.contains(qName)) {
        name = "tag";
        tagNameAttr = new TagAttributeImpl(location, namespace, QNAME, QNAME, qName);
      }
      for (TagAttribute attr : attrs) {
        if ("data-error".equals(attr.getQName())) {
          tagNameAttr = new TagAttributeImpl(location, namespace, QNAME, QNAME, qName);
          name =  qName;
        } else if ("data-label".equals(attr.getQName()) && !StringUtils.isEmpty(attr.getValue())) {
          tagNameAttr = new TagAttributeImpl(location, namespace, QNAME, QNAME, qName);
          name = qName;
        } else if ("data-template".equals(attr.getQName())) {
          tagNameAttr = new TagAttributeImpl(location, namespace, QNAME, QNAME, qName);
          name = "html".equals(qName) ? "html" : "template";
        } else if ("data-repeat".equals(attr.getQName())) {
          tagNameAttr = new TagAttributeImpl(location, namespace, QNAME, QNAME, qName);
          if (!"select".equals(name)) {
            name = "repeat";
          }
        } else if ("target".equals(attr.getQName())) {
          tagTargetAttr = null;
        }
        if (attr.getQName().startsWith("data-") && !attr.getQName().equals("data-rendered")) {
          String replace = convertName(attr.getQName());
          if (replace.matches(ATTRIBUTES)) {
            attrs.set(attrs.indexOf(attr),
                new TagAttributeImpl(location, attr.getNamespace(), replace, replace, attr.getValue()));
          }
        }
        if ("id".equals(attr.getQName())) {
         
          if (attr.getValue().contains("${")) {
View Full Code Here

    return StringUtils.join(parts, "");
  }
 
  private void replaceAttr(List<TagAttribute> attrs, TagAttribute attr, String value, String search, String replace) {
    if (search.equals(attr.getQName())) {
      attrs.set(attrs.indexOf(attr), new TagAttributeImpl(
          attr.getLocation(), attr.getNamespace(), replace, replace, value));
    }
  } 
View Full Code Here

TOP

Related Classes of com.sun.faces.facelets.tag.TagAttributeImpl

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.