Class GetPropertyTag

java.lang.Object
javax.servlet.jsp.tagext.TagSupport
org.apache.sling.scripting.jsp.taglib.GetPropertyTag
All Implemented Interfaces:
Serializable, IterationTag, JspTag, Tag

public class GetPropertyTag extends TagSupport
Tag for retrieving a property from a ValueMap.
See Also:
  • Constructor Details

    • GetPropertyTag

      public GetPropertyTag()
  • Method Details

    • doEndTag

      public int doEndTag()
      Description copied from class: TagSupport
      Default processing of the end tag returning EVAL_PAGE.
      Specified by:
      doEndTag in interface Tag
      Overrides:
      doEndTag in class TagSupport
      Returns:
      EVAL_PAGE
      See Also:
    • getDefaultValue

      public Object getDefaultValue()
      Gets the default value to return if no value exists for the key. If specified, this takes precedence over returnClass.
      Returns:
      the default value
    • getKey

      public String getKey()
      Gets key to retrieve the value from from the ValueMap.
      Returns:
      the key
    • getProperties

      public ValueMap getProperties()
      Gets the ValueMap from which to retrieve the value.
      Returns:
      the ValueMap of properties
    • getReturnClass

      public String getReturnClass()
      Gets the name of class into which to coerce the returned value.
      Returns:
      the class name
    • getVar

      public String getVar()
      Gets the variable name to which to save the value
      Returns:
      the variable name
    • setDefaultValue

      public void setDefaultValue(Object defaultValue)
      Sets the default value to return if no value exists for the key. If specified, this takes precedence over returnClass.
      Parameters:
      defaultValue - the default value
    • setKey

      public void setKey(String key)
      Sets the key to retrieve the value from from the ValueMap.
      Parameters:
      key - the key
    • setProperties

      public void setProperties(ValueMap properties)
      Sets the ValueMap from which to retrieve the value.
      Parameters:
      properties - the ValueMap of properties
    • setReturnClass

      public void setReturnClass(String returnClass)
      Sets the name of class into which to coerce the returned value.
      Parameters:
      returnClass - the class name
    • setVar

      public void setVar(String var)
      Sets the variable name to which to save the value.
      Parameters:
      var - the variable name