Class DefaultMethodValueTag

java.lang.Object
jakarta.servlet.jsp.tagext.TagSupport
org.deltava.taglib.content.DefaultMethodValueTag
All Implemented Interfaces:
jakarta.servlet.jsp.tagext.IterationTag, jakarta.servlet.jsp.tagext.JspTag, jakarta.servlet.jsp.tagext.Tag, Serializable
Direct Known Subclasses:
DefaultMethodTag, EnumDescriptionTag

public class DefaultMethodValueTag extends jakarta.servlet.jsp.tagext.TagSupport
A JSP tag to call default interface methods since EL is stupid.
Since:
10.0
Version:
11.2
Author:
Luke
See Also:
  • Field Summary

    Fields inherited from class jakarta.servlet.jsp.tagext.TagSupport

    id, pageContext

    Fields inherited from interface jakarta.servlet.jsp.tagext.IterationTag

    EVAL_BODY_AGAIN

    Fields inherited from interface jakarta.servlet.jsp.tagext.Tag

    EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
    protected Object
    Retrieves the method's return value via reflection.
    protected boolean
    Returns whether the object to executae against is present.
    void
    setMethod(String methodName)
    Sets the method name to find and call.
    void
    Sets the object to execute against.
    void
    setVar(String vName)
    Sets the request attribute name.

    Methods inherited from class jakarta.servlet.jsp.tagext.TagSupport

    doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue

    Methods inherited from class Object

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

    • DefaultMethodValueTag

      public DefaultMethodValueTag()
  • Method Details

    • setVar

      public void setVar(String vName)
      Sets the request attribute name.
      Parameters:
      vName - the name of the request attribute to store the data in
    • setObject

      public void setObject(Object o)
      Sets the object to execute against.
      Parameters:
      o - the Object
    • setMethod

      public void setMethod(String methodName)
      Sets the method name to find and call.
      Parameters:
      methodName - the method name, minus get or set
    • hasObject

      protected boolean hasObject()
      Returns whether the object to executae against is present.
      Returns:
      TRUE if not null, otherwise FALSE
    • getValue

      protected Object getValue() throws Exception
      Retrieves the method's return value via reflection.
      Returns:
      an Object
      Throws:
      Exception - if an error occurs
    • doStartTag

      public int doStartTag() throws jakarta.servlet.jsp.JspException
      Specified by:
      doStartTag in interface jakarta.servlet.jsp.tagext.Tag
      Overrides:
      doStartTag in class jakarta.servlet.jsp.tagext.TagSupport
      Throws:
      jakarta.servlet.jsp.JspException