Annotation Type HierarchicalPageProperty
@Target({METHOD,FIELD,PARAMETER})
@Retention(RUNTIME)
@InjectAnnotation
public @interface HierarchicalPageProperty
Injects a hierarchical page property.
Traverses upwards in the page hierarchy until the property is found.
Note: not supported by the javax.Inject annotation because of performance reasons. Only direct annotation is supported.
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanSpecifies if it should use the hierarchy to search for the page property.org.apache.sling.models.annotations.injectorspecific.InjectionStrategyif set to REQUIRED injection is mandatory, if set to OPTIONAL injection is optional, in case of DEFAULT the standard annotations (Optional,Required) are used.intStart traversing upwards in the hierarchy from a specific level, skipping lower levels.booleanWhether to use the current page (true) or the resource page (false).Specifies the name of the value from the value map to take.
-
Element Details
-
traverseFromAbsoluteParent
int traverseFromAbsoluteParentStart traversing upwards in the hierarchy from a specific level, skipping lower levels.- Since:
- 6.0.16
- Default:
- -1
-
useCurrentPage
boolean useCurrentPageWhether to use the current page (true) or the resource page (false).- Returns:
- Default:
- false
-
value
String valueSpecifies the name of the value from the value map to take. If empty, then the name is derived from the method or field.- Default:
- ""
-
inherit
boolean inheritSpecifies if it should use the hierarchy to search for the page property. If false, it will only look at the current page.- Default:
- true
-
injectionStrategy
org.apache.sling.models.annotations.injectorspecific.InjectionStrategy injectionStrategyif set to REQUIRED injection is mandatory, if set to OPTIONAL injection is optional, in case of DEFAULT the standard annotations (Optional,Required) are used. If even those are not available the default injection strategy defined on theModelapplies. Default value = DEFAULT.- Default:
- DEFAULT
-