Package javax.faces.view.facelets

Examples of javax.faces.view.facelets.TagAttribute


        }

        public MetaRuleset alias(String attribute, String property) {
            assert (attribute != null);
            assert (property != null);
            TagAttribute attr =
                (TagAttribute)this.attributes.remove(attribute);
            if (attr != null) {
                this.attributes.put(property, attr);
            }
            return this;
View Full Code Here


  protected MetaRuleset createMetaRuleset(final Class aClass) {
    final MetaRuleset metaRuleset = super.createMetaRuleset(aClass);
    final TagAttribute[] attrs = tag.getAttributes().getAll();
    for (int i = 0; i < attrs.length; i++) {
      final TagAttribute attr = attrs[i];
      if (!attr.getLocalName().equals("rendered")) {
        metaRuleset.ignore(attr.getLocalName());
      }
    }
    return metaRuleset;
  }
View Full Code Here

        super(config);
        this.locale = this.getAttribute("locale");
        this.renderKitId = this.getAttribute("renderKitId");
        this.contentType = this.getAttribute("contentType");
        this.encoding = this.getAttribute("encoding");
        TagAttribute testForNull = this.getAttribute("beforePhase");
        this.beforePhase = (null == testForNull) ?
                         this.getAttribute("beforePhaseListener") : testForNull;
        testForNull = this.getAttribute("afterPhase");
        this.afterPhase = (null == testForNull) ?
                         this.getAttribute("afterPhaseListener") : testForNull;
View Full Code Here

           
            if (this.compiler.isDevelopmentProjectStage())
            {
                String qName = null;
                boolean isPrefixed = false;
                TagAttribute jsfc = t.getAttributes().get("jsfc");
                if (jsfc != null)
                {
                    qName = jsfc.getValue();
                    if (jsfc.getValue().indexOf(':') > 0)
                    {
                        isPrefixed = true;
                    }
                }
                else if (t.getQName().indexOf(':') > 0 )
View Full Code Here

            && ImplementationHandler.NAME.equals(name);
    }

    private String[] determineQName(Tag tag)
    {
        TagAttribute attr = tag.getAttributes().get("jsfc");
        if (attr != null)
        {
            if (log.isLoggable(Level.FINE))
            {
                log.fine(attr + " JSF Facelet Compile Directive Found");
            }
            String value = attr.getValue();
            String namespace;
            String localName;
            int c = value.indexOf(':');
            if (c == -1)
            {
View Full Code Here

        }
    }

    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;
View Full Code Here

    public MetaRuleset alias(String attribute, String property)
    {
        ParameterCheck.notNull("attribute", attribute);
        ParameterCheck.notNull("property", property);

        TagAttribute attr = (TagAttribute) _attributes.remove(attribute);
        if (attr != null)
        {
            _attributes.put(property, attr);
        }
View Full Code Here

     * TODO: Document me!
     */
    @JSFFaceletAttribute
    public String getFor()
    {
        TagAttribute forAttribute = getAttribute("for");
       
        if (forAttribute == null)
        {
            return null;
        }
        else
        {
            return forAttribute.getValue();
        }
    }
View Full Code Here

    }
   
    private TagAttributes convertTagAttributes(Tag tag)
    {
        TagAttributes tagAttributes = tag.getAttributes();
        TagAttribute elementNameTagAttribute = new TagAttributeImpl(
            tag.getLocation(), PASS_THROUGH_NAMESPACE , Renderer.PASSTHROUGH_RENDERER_LOCALNAME_KEY,
            P_ELEMENTNAME, tag.getLocalName() );
        TagAttribute[] sourceTagAttributes = tag.getAttributes().getAll();
        TagAttribute[] convertedTagAttributes = new TagAttribute[sourceTagAttributes.length+1];
        boolean elementNameTagAttributeSet = false;
           
        for (int i = 0; i < sourceTagAttributes.length; i++)
        {
            TagAttribute tagAttribute = sourceTagAttributes[i];
            String convertedNamespace;
            String qname;
            String namespace = tagAttribute.getNamespace();
            if (JSF_NAMESPACE.equals(namespace) || JSF_ALIAS_NAMESPACE.equals(namespace))
            {
                // "... If the current attribute's namespace is http://xmlns.jcp.org/jsf, convertedTagAttribute's
                //  qualified name must be the current attribute's local name and convertedTagAttribute's
                // namespace must be the empty string. This will have the effect of setting the current
                // attribute as a proper property on the UIComponent instance represented by this markup.
                convertedNamespace = "";
                qname = tagAttribute.getLocalName();
               
                convertedTagAttributes[i] = new TagAttributeImpl(tagAttribute.getLocation(),
                    convertedNamespace, tagAttribute.getLocalName(), qname, tagAttribute.getValue());
               
                if (Renderer.PASSTHROUGH_RENDERER_LOCALNAME_KEY.equals(tagAttribute.getLocalName()))
                {
                    elementNameTagAttributeSet = true;
                }
            }
            else if (namespace == null)
            {
                // should not happen, but let it because org.xml.sax.Attributes considers it
                convertedTagAttributes[i] = tagAttribute;
            }
            else if (tagAttribute.getNamespace().length() == 0)
            {
                // "... If the current attribute's namespace is empty
                // let the current attribute be convertedTagAttribute. ..."
                convertedTagAttributes[i] = tagAttribute;
            }
            else if (!tag.getNamespace().equals(tagAttribute.getNamespace()))
            {
                // "... or different from the argument tag's namespace,
                // let the current attribute be convertedTagAttribute. ..."
                convertedTagAttributes[i] = tagAttribute;
            }
            else
            {
                // "... Otherwise, assume the current attribute's namespace is http://xmlns.jcp.org/jsf/passthrough.
                // ConvertedTagAttribute's qualified name is the current attribute's local name prefixed by
                // p:". convertedTagAttribute's namespace must be http://xmlns.jcp.org/jsf/passthrough.
                convertedNamespace = PASS_THROUGH_NAMESPACE;
                qname = "p:"+tagAttribute.getLocalName();
               
                convertedTagAttributes[i] = new TagAttributeImpl(tagAttribute.getLocation(),
                    convertedNamespace, tagAttribute.getLocalName(), qname, tagAttribute.getValue());
            }
        }
       
        if (elementNameTagAttributeSet)
        {
View Full Code Here

            if (attributeQName != null)
            {
                 if (matchValue != null)
                 {
                     String attributeNS = attributeNamespace;
                     TagAttribute attr = tag.getAttributes().get(attributeNS, attributeLocalName);
                     if (attr == null && attributeAliasNamespace.length() > 0)
                     {
                         attributeNS = attributeAliasNamespace;
                         attr = tag.getAttributes().get(attributeAliasNamespace, attributeLocalName);
                     }
                     if (attr != null)
                     {
                         if (attributeNS.equals(attr.getNamespace()) )
                         {
                            // if namespace is the same match
                             if (matchValue.equals(attr.getValue()))
                             {
                                return this;
                             }
                             else if ("*".equals(matchValue) && attr.getValue() != null)
                             {
                                 return this;
                             }
                         }
                         else if (attributeNS == "" && attr.getNamespace() == null)
                         {
                             // if namespace is empty match
                             if (matchValue.equals(attr.getValue()))
                             {
                                 return this;
                             }
                             else if ("*".equals(matchValue) && attr.getValue() != null)
                             {
                                 return this;
                             }
                         }
                     }
                 }
                 else
                 {
                     String attributeNS = attributeNamespace;
                     TagAttribute attr = tag.getAttributes().get(attributeNS, attributeLocalName);
                     if (attr == null)
                     {
                         attributeNS = attributeAliasNamespace;
                         attr = tag.getAttributes().get(attributeNS, attributeLocalName);
                     }
                     if (attr != null)
                     {
                         if (attributeNS.equals(attr.getNamespace()))
                         {
                             // if namespace is the same match
                             return this;
                         }
                         else if (attributeNS == "" && attr.getNamespace() == null)
                         {
                             // if namespace is empty match
                             return this;
                         }
                     }
View Full Code Here

TOP

Related Classes of javax.faces.view.facelets.TagAttribute

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.