Class SetSupport

  • All Implemented Interfaces:
    java.io.Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag
    Direct Known Subclasses:
    SetTag, SetTag

    public abstract class SetSupport
    extends javax.servlet.jsp.tagext.BodyTagSupport

    Support for handlers of the <set> tag.

    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String scope  
      private java.lang.String var  
      • Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport

        bodyContent
      • Fields inherited from class javax.servlet.jsp.tagext.TagSupport

        id, pageContext
      • Fields inherited from interface javax.servlet.jsp.tagext.BodyTag

        EVAL_BODY_BUFFERED, EVAL_BODY_TAG
      • Fields inherited from interface javax.servlet.jsp.tagext.IterationTag

        EVAL_BODY_AGAIN
      • Fields inherited from interface javax.servlet.jsp.tagext.Tag

        EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected SetSupport()
      Constructs a new handler.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      private java.lang.Object convertToExpectedType​(java.lang.Object value, java.lang.reflect.Method m)
      Convert an object to an expected type of the method parameter according to the conversion rules of the Expression Language.
      int doEndTag()  
      protected abstract java.lang.String evalProperty()
      Evaluate the property attribute.
      protected abstract java.lang.Object evalTarget()
      Evaluate the target attribute.
      protected abstract java.lang.Object evalValue()
      Evaluate the value attribute.
      (package private) void exportToBeanProperty​(java.lang.Object target, java.lang.String property, java.lang.Object result)
      Export the result into a bean property.
      (package private) void exportToMapProperty​(java.lang.Object target, java.lang.String property, java.lang.Object result)
      Export the result into a Map.
      (package private) void exportToVariable​(java.lang.Object result)
      Export the result into a scoped variable.
      protected javax.el.ExpressionFactory getExpressionFactory()  
      (package private) java.lang.Object getResult()  
      protected abstract boolean isValueSpecified()
      Indicates that the value attribute was specified.
      void release()  
      void setScope​(java.lang.String scope)
      Scope for var.
      void setVar​(java.lang.String var)
      Name of the exported scoped variable to hold the value specified in the action.
      • Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport

        doAfterBody, doInitBody, doStartTag, getBodyContent, getPreviousOut, setBodyContent
      • Methods inherited from class javax.servlet.jsp.tagext.TagSupport

        findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface javax.servlet.jsp.tagext.Tag

        getParent, setPageContext, setParent
    • Field Detail

      • var

        private java.lang.String var
      • scope

        private java.lang.String scope
    • Constructor Detail

      • SetSupport

        protected SetSupport()
        Constructs a new handler. As with TagSupport, subclasses should not provide other constructors and are expected to call the superclass constructor.
    • Method Detail

      • release

        public void release()
        Specified by:
        release in interface javax.servlet.jsp.tagext.Tag
        Overrides:
        release in class javax.servlet.jsp.tagext.BodyTagSupport
      • doEndTag

        public int doEndTag()
                     throws javax.servlet.jsp.JspException
        Specified by:
        doEndTag in interface javax.servlet.jsp.tagext.Tag
        Overrides:
        doEndTag in class javax.servlet.jsp.tagext.BodyTagSupport
        Throws:
        javax.servlet.jsp.JspException
      • getResult

        java.lang.Object getResult()
                            throws javax.servlet.jsp.JspException
        Throws:
        javax.servlet.jsp.JspException
      • isValueSpecified

        protected abstract boolean isValueSpecified()
        Indicates that the value attribute was specified. If no value attribute is supplied then the value is taken from the tag's body content.
        Returns:
        true if the value attribute was specified
      • evalValue

        protected abstract java.lang.Object evalValue()
                                               throws javax.servlet.jsp.JspException
        Evaluate the value attribute.
        Returns:
        the result of evaluating the value attribute
        Throws:
        javax.servlet.jsp.JspException - if there was a problem evaluating the expression
      • evalTarget

        protected abstract java.lang.Object evalTarget()
                                                throws javax.servlet.jsp.JspException
        Evaluate the target attribute.
        Returns:
        the result of evaluating the target attribute
        Throws:
        javax.servlet.jsp.JspException - if there was a problem evaluating the expression
      • evalProperty

        protected abstract java.lang.String evalProperty()
                                                  throws javax.servlet.jsp.JspException
        Evaluate the property attribute.
        Returns:
        the result of evaluating the property attribute
        Throws:
        javax.servlet.jsp.JspException - if there was a problem evaluating the expression
      • exportToVariable

        void exportToVariable​(java.lang.Object result)
                       throws javax.servlet.jsp.JspTagException
        Export the result into a scoped variable.
        Parameters:
        result - the value to export
        Throws:
        javax.servlet.jsp.JspTagException - if there was a problem exporting the result
      • exportToMapProperty

        void exportToMapProperty​(java.lang.Object target,
                                 java.lang.String property,
                                 java.lang.Object result)
        Export the result into a Map.
        Parameters:
        target - the Map to export into
        property - the key to export into
        result - the value to export
      • exportToBeanProperty

        void exportToBeanProperty​(java.lang.Object target,
                                  java.lang.String property,
                                  java.lang.Object result)
                           throws javax.servlet.jsp.JspTagException
        Export the result into a bean property.
        Parameters:
        target - the bean to export into
        property - the bean property to set
        result - the value to export
        Throws:
        javax.servlet.jsp.JspTagException - if there was a problem exporting the result
      • convertToExpectedType

        private java.lang.Object convertToExpectedType​(java.lang.Object value,
                                                       java.lang.reflect.Method m)
                                                throws javax.el.ELException
        Convert an object to an expected type of the method parameter according to the conversion rules of the Expression Language.
        Parameters:
        value - the value to convert
        m - the setter method
        Returns:
        value converted to an instance of the expected type; will be null if value was null
        Throws:
        javax.el.ELException - if there was a problem coercing the value
      • getExpressionFactory

        protected javax.el.ExpressionFactory getExpressionFactory()
      • setVar

        public void setVar​(java.lang.String var)
        Name of the exported scoped variable to hold the value specified in the action. The type of the scoped variable is whatever type the value expression evaluates to.
        Parameters:
        var - name of the exported scoped variable
      • setScope

        public void setScope​(java.lang.String scope)
        Scope for var. Values are verified by TLV.
        Parameters:
        scope - the variable scope