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

# Class GetParentTag

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

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

public class GetParentTag extends javax.servlet.jsp.tagext.TagSupport
Tag for retrieving a parent resource based on the absolute parent level

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
`GetParentTag()`

## Method Summary

Modifier and Type
Method
Description
`int`
`doEndTag()`
`String`
`getLevel()`
Get the level of the parent resource to retrieve.
`org.apache.sling.api.resource.Resource`
`getResource()`
Gets the resource.
`String`
`getVar()`
Gets the variable name to which to save the list of children.
`void`
`setLevel(String level)`
Set the level of the parent resource to retrieve.
`void`
`setResource(org.apache.sling.api.resource.Resource resource)`
Sets the resource.
`void`
`setVar(String var)`
Sets the variable name to which to save the parent resource.

### 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

### GetParentTag

public GetParentTag()

## 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`

### getResource

public org.apache.sling.api.resource.Resource getResource()
Gets the resource.

Returns:
  the resource

### getLevel

public String getLevel()
Get the level of the parent resource to retrieve.

Returns:
  the level

### getVar

public String getVar()
Gets the variable name to which to save the list of children.

Returns:
  the variable name

### setResource

public void setResource(org.apache.sling.api.resource.Resource resource)
Sets the resource.

Parameters:
  `resource` - the new resource

### setLevel

public void setLevel(String level)
Set the level of the parent resource to retrieve.

Parameters:
  `level` - the level

### setVar

public void setVar(String var)
Sets the variable name to which to save the parent resource.

Parameters:
  `var` - the variable name