Class TagAttribute



  • public abstract class TagAttribute
    extends java.lang.Object

    Representation of an XML attribute name=value pair on an XML element in a Facelet file.

    Since:
    2.0
    • Constructor Summary

      Constructors 
      Constructor Description
      TagAttribute​()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract boolean getBoolean​(FaceletContext ctx)
      If literal,return Boolean.valueOf(java.lang.String) passing our value, otherwise call getObject(FaceletContext, Class).
      abstract int getInt​(FaceletContext ctx)
      If literal, call Integer.parseInt(String), otherwise call getObject(FaceletContext, Class).
      abstract java.lang.String getLocalName​()
      Local name of this attribute
      abstract Location getLocation​()
      The location of this attribute in the FaceletContext
      abstract MethodExpression getMethodExpression​(FaceletContext ctx, java.lang.Class type, java.lang.Class[] paramTypes)
      Create a MethodExpression, using this attribute's value as the expression String.
      abstract java.lang.String getNamespace​()
      The resolved Namespace for this attribute
      abstract java.lang.Object getObject​(FaceletContext ctx)
      Delegates to getObject with Object.class as a param
      abstract java.lang.Object getObject​(FaceletContext ctx, java.lang.Class type)
      If literal, simply coerce our String literal value using an ExpressionFactory, otherwise create a ValueExpression and evaluate it.
      abstract java.lang.String getQName​()
      The qualified name for this attribute
      Tag getTag​()
      A reference to the Tag for which this class represents the attributes.
      abstract java.lang.String getValue​()
      Return the literal value of this attribute
      abstract java.lang.String getValue​(FaceletContext ctx)
      If literal, then return our value, otherwise delegate to getObject, passing String.class.
      abstract ValueExpression getValueExpression​(FaceletContext ctx, java.lang.Class type)
      Create a ValueExpression, using this attribute's literal value and the passed expected type.
      abstract boolean isLiteral​()
      If this TagAttribute is literal (not #{..} or ${..})
      void setTag​(Tag tag)
      Set a reference to the Tag for which this class represents the attributes.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TagAttribute

        public TagAttribute​()
    • Method Detail

      • getLocalName

        public abstract java.lang.String getLocalName​()
        Local name of this attribute
        Returns:
        local name of this attribute
      • getLocation

        public abstract Location getLocation​()
        The location of this attribute in the FaceletContext
        Returns:
        the TagAttribute's location
      • getNamespace

        public abstract java.lang.String getNamespace​()
        The resolved Namespace for this attribute
        Returns:
        resolved Namespace
      • getObject

        public abstract java.lang.Object getObject​(FaceletContext ctx)
        Delegates to getObject with Object.class as a param
        Parameters:
        ctx - FaceletContext to use
        Returns:
        Object representation of this attribute's value
        See Also:
        getObject(FaceletContext, Class)
      • getQName

        public abstract java.lang.String getQName​()
        The qualified name for this attribute
        Returns:
        the qualified name for this attribute
      • getValue

        public abstract java.lang.String getValue​()
        Return the literal value of this attribute
        Returns:
        literal value
      • getValue

        public abstract java.lang.String getValue​(FaceletContext ctx)
        If literal, then return our value, otherwise delegate to getObject, passing String.class.
        Parameters:
        ctx - FaceletContext to use
        Returns:
        String value of this attribute
        See Also:
        getObject(FaceletContext, Class)
      • isLiteral

        public abstract boolean isLiteral​()
        If this TagAttribute is literal (not #{..} or ${..})
        Returns:
        true if this attribute is literal.
      • getTag

        public Tag getTag​()

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

        Returns:
        the Tag for which this class represents the attributes.
        Since:
        2.2
      • setTag

        public void setTag​(Tag tag)

        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.

        Parameters:
        tag - the tag we represent.
        Since:
        2.2