@ProviderType public final class ComponentPropertyResolver extends Object
The lookup takes place in:
By default, only option 3 is enabled (with inheritance).
Constructor and Description |
---|
ComponentPropertyResolver(@NotNull com.day.cq.wcm.api.components.ComponentContext wcmComponentContext)
Content resource associated with a component (resource type).
|
ComponentPropertyResolver(@NotNull com.day.cq.wcm.api.Page page)
Content resource associated with a component (resource type).
|
ComponentPropertyResolver(@NotNull org.apache.sling.api.resource.Resource resource)
Content resource associated with a component (resource type).
|
ComponentPropertyResolver(@NotNull org.apache.sling.api.resource.Resource resource,
boolean ensureResourceType)
Content resource associated with a component (resource type).
|
Modifier and Type | Method and Description |
---|---|
ComponentPropertyResolver |
componentPropertiesResolution(@NotNull ComponentPropertyResolution resolution)
Configure if properties should be resolved in component properties, and with or without inheritance.
|
ComponentPropertyResolver |
contentPolicyResolution(@NotNull ComponentPropertyResolution resolution)
Configure if properties should be resolved from content policies mapped for the given resource.
|
<T> T |
get(@NotNull String name,
@NotNull Class<T> type)
Get property.
|
<T> T |
get(@NotNull String name,
T defaultValue)
Get property.
|
@Nullable Collection<org.apache.sling.api.resource.Resource> |
getResources(@NotNull String name)
Get list of child resources.
|
ComponentPropertyResolver |
pagePropertiesResolution(@NotNull ComponentPropertyResolution resolution)
Configure if properties should be resolved in content page properties, and with or without inheritance.
|
public ComponentPropertyResolver(@NotNull @NotNull com.day.cq.wcm.api.Page page)
page
- Content pagepublic ComponentPropertyResolver(@NotNull @NotNull org.apache.sling.api.resource.Resource resource)
resource
- Content resourcepublic ComponentPropertyResolver(@NotNull @NotNull org.apache.sling.api.resource.Resource resource, boolean ensureResourceType)
resource
- Content resourceensureResourceType
- Ensure the given resource has a resource type.
If this is not the case, try to find the closest parent resource which has a resource type.public ComponentPropertyResolver(@NotNull @NotNull com.day.cq.wcm.api.components.ComponentContext wcmComponentContext)
wcmComponentContext
- WCM component contextpublic ComponentPropertyResolver componentPropertiesResolution(@NotNull @NotNull ComponentPropertyResolution resolution)
ComponentPropertyResolution.RESOLVE_INHERIT
.resolution
- Resolution modepublic ComponentPropertyResolver pagePropertiesResolution(@NotNull @NotNull ComponentPropertyResolution resolution)
ComponentPropertyResolution.IGNORE
.resolution
- Resolution modepublic ComponentPropertyResolver contentPolicyResolution(@NotNull @NotNull ComponentPropertyResolution resolution)
ComponentPropertyResolution.RESOLVE_INHERIT
has the same effect as ComponentPropertyResolution.RESOLVE
in this case.
Default mode is ComponentPropertyResolution.IGNORE
.resolution
- Resolution mode@Nullable public <T> T get(@NotNull @NotNull String name, @NotNull @NotNull Class<T> type)
T
- Parameter typename
- Property nametype
- Property type@NotNull public <T> T get(@NotNull @NotNull String name, @NotNull T defaultValue)
T
- Parameter typename
- Property namedefaultValue
- Default value@Nullable public @Nullable Collection<org.apache.sling.api.resource.Resource> getResources(@NotNull @NotNull String name)
name
- Child node nameCopyright © 2014–2019 wcm.io. All rights reserved.