Class TagAttributeImpl


  • public class TagAttributeImpl
    extends TagAttribute
    Representation of a Tag's attribute in a Facelet File
    Version:
    $Id$
    Author:
    Jacob Hookom
    • Constructor Detail

      • TagAttributeImpl

        public TagAttributeImpl()
    • Method Detail

      • getLocalName

        public String getLocalName()
        Local name of this attribute
        Specified by:
        getLocalName in class TagAttribute
        Returns:
        local name of this attribute
      • getLocation

        public Location getLocation()
        The location of this attribute in the FaceletContext
        Specified by:
        getLocation in class TagAttribute
        Returns:
        the TagAttributeImpl's location
      • getMethodExpression

        public jakarta.el.MethodExpression getMethodExpression​(FaceletContext ctx,
                                                               Class type,
                                                               Class[] paramTypes)
        Create a MethodExpression, using this attribute's value as the expression String.
        Specified by:
        getMethodExpression in class TagAttribute
        Parameters:
        ctx - FaceletContext to use
        type - expected return type
        paramTypes - parameter type
        Returns:
        a MethodExpression instance
        See Also:
        ExpressionFactory.createMethodExpression(jakarta.el.ELContext, java.lang.String, java.lang.Class, java.lang.Class[]), MethodExpression
      • getNamespace

        public String getNamespace()
        The resolved Namespace for this attribute
        Specified by:
        getNamespace in class TagAttribute
        Returns:
        resolved Namespace
      • getQName

        public String getQName()
        The qualified name for this attribute
        Specified by:
        getQName in class TagAttribute
        Returns:
        the qualified name for this attribute
      • getTag

        public Tag getTag()
        Description copied from class: TagAttribute

        A reference to the Tag for which this class represents the attributes. For compatibility with previous implementations, an implementation is provided that returns null.

        Overrides:
        getTag in class TagAttribute
        Returns:
        the Tag for which this class represents the attributes.
      • setTag

        public void setTag​(Tag tag)
        Description copied from class: TagAttribute

        Set a reference to the Tag for which this class represents the attributes. The VDL runtime must ensure that this method is called before any FaceletHandlers for this element are instantiated. For compatibility with previous implementations, a no-op implementation is provided.

        Overrides:
        setTag in class TagAttribute
        Parameters:
        tag - the tag we represent.
      • getValue

        public String getValue()
        Return the literal value of this attribute
        Specified by:
        getValue in class TagAttribute
        Returns:
        literal value
      • getObject

        public Object getObject​(FaceletContext ctx,
                                Class type)
        If literal, simply coerce our String literal value using an ExpressionFactory, otherwise create a ValueExpression and evaluate it.
        Specified by:
        getObject in class TagAttribute
        Parameters:
        ctx - FaceletContext to use
        type - expected return type
        Returns:
        Object value of this attribute
        See Also:
        ExpressionFactory.coerceToType(java.lang.Object, java.lang.Class), ExpressionFactory.createValueExpression(jakarta.el.ELContext, java.lang.String, java.lang.Class), ValueExpression
      • getValueExpression

        public jakarta.el.ValueExpression getValueExpression​(FaceletContext ctx,
                                                             Class type)
        Create a ValueExpression, using this attribute's literal value and the passed expected type.
        Specified by:
        getValueExpression in class TagAttribute
        Parameters:
        ctx - FaceletContext to use
        type - expected return type
        Returns:
        ValueExpression instance
        See Also:
        ExpressionFactory.createValueExpression(jakarta.el.ELContext, java.lang.String, java.lang.Class), ValueExpression
      • isLiteral

        public boolean isLiteral()
        If this TagAttributeImpl is literal (not #{..} or ${..})
        Specified by:
        isLiteral in class TagAttribute
        Returns:
        true if this attribute is literal
      • getValueExpression

        public jakarta.el.ValueExpression getValueExpression​(FaceletContext ctx,
                                                             String expr,
                                                             Class type)