Package org.apache.sling.scripting.jsp.taglib

# Class GetPropertyTag

java.lang.Object
javax.servlet.jsp.tagext.TagSupport
org.apache.sling.scripting.jsp.taglib.GetPropertyTag

All Implemented Interfaces:
  `Serializable`, `javax.servlet.jsp.tagext.IterationTag`, `javax.servlet.jsp.tagext.JspTag`, `javax.servlet.jsp.tagext.Tag`

public class GetPropertyTag extends javax.servlet.jsp.tagext.TagSupport
Tag for retrieving a property from a ValueMap.

See Also:
  - Serialized Form

## Field Summary

### Fields inherited from class javax.servlet.jsp.tagext.TagSupport

`id, pageContext`

### 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
Constructor
Description
`GetPropertyTag()`

## Method Summary

Modifier and Type
Method
Description
`int`
`doEndTag()`
`protected ClassLoader`
`getClassLoader()`
Method for retrieving the classloader from the OSGi console.
`Object`
`getDefaultValue()`
Gets the default value to return if no value exists for the key.
`String`
`getKey()`
Gets key to retrieve the value from from the ValueMap.
`org.apache.sling.api.resource.ValueMap`
`getProperties()`
Gets the ValueMap from which to retrieve the value.
`String`
`getReturnClass()`
Gets the name of class into which to coerce the returned value.
`String`
`getVar()`
Gets the variable name to which to save the value
`void`
`setDefaultValue(Object defaultValue)`
Sets the default value to return if no value exists for the key.
`void`
`setKey(String key)`
Sets the key to retrieve the value from from the ValueMap.
`void`
`setProperties(org.apache.sling.api.resource.ValueMap properties)`
Sets the ValueMap from which to retrieve the value.
`void`
`setReturnClass(String returnClass)`
Sets the name of class into which to coerce the returned value.
`void`
`setVar(String var)`
Sets the variable name to which to save the value.

### Methods inherited from class javax.servlet.jsp.tagext.TagSupport

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

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### GetPropertyTag

public GetPropertyTag()

## Method Details

### doEndTag

public int doEndTag()

Specified by:
  `doEndTag` in interface `javax.servlet.jsp.tagext.Tag`
Overrides:
  `doEndTag` in class `javax.servlet.jsp.tagext.TagSupport`

### getClassLoader

protected ClassLoader getClassLoader()
Method for retrieving the classloader from the OSGi console.

Returns:
  the classloader

### 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 org.apache.sling.api.resource.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(org.apache.sling.api.resource.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