Package org.apache.sling.resourcemerger.impl.picker

## Class ResourceTypeHierarchyBasedResourcePicker

- java.lang.Object
- - org.apache.sling.resourcemerger.impl.picker.ResourceTypeHierarchyBasedResourcePicker

All Implemented Interfaces:
  `MergedResourcePicker2`

    public class ResourceTypeHierarchyBasedResourcePicker
    extends Object
    implements MergedResourcePicker2

### Field Summary

Fields
`static String` `DEFAULT_ROOT`

### Fields inherited from interface org.apache.sling.resourcemerger.spi.MergedResourcePicker2

`MERGE_ROOT, READ_ONLY, TRAVERSE_PARENT`

### Constructor Summary

Constructors
`ResourceTypeHierarchyBasedResourcePicker()`

### Method Summary

All Methods Instance Methods Concrete Methods
`protected void` `activate​(org.apache.sling.resourcemerger.impl.picker.ResourceTypeHierarchyBasedResourcePicker.Configuration config)`
`List<org.apache.sling.api.resource.Resource>` `pickResources​(org.apache.sling.api.resource.ResourceResolver resolver, String relativePath, org.apache.sling.api.resource.Resource relatedResource)` Method invoked by the MergingResourceProvider to identify the resources to be merged for a given relative path.

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

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

### Field Detail

#### DEFAULT_ROOT

    public static final String DEFAULT_ROOT

See Also:
  Constant Field Values

### Constructor Detail

#### ResourceTypeHierarchyBasedResourcePicker

    public ResourceTypeHierarchyBasedResourcePicker()

### Method Detail

#### pickResources

    public List<org.apache.sling.api.resource.Resource> pickResources​(org.apache.sling.api.resource.ResourceResolver resolver,
                                                                      String relativePath,
                                                                      org.apache.sling.api.resource.Resource relatedResource)

Description copied from interface: `MergedResourcePicker2`
Method invoked by the MergingResourceProvider to identify the resources to be merged for a given relative path. The resources returned may be either resources returned from the ResourceResolver directory or an instance of NonExistingResource. Returning an empty list will cause the resource to not exist for consumers (resolver.getResource(path) will return null).

Specified by:
  `pickResources` in interface `MergedResourcePicker2`
Parameters:
  `resolver` - the ResourceResolver
  `relativePath` - the path relative to the merge root
  `relatedResource` - an optional resource which is related to the given path (always the parent resource or `null`)
Returns:
  a List of Resource objects

#### activate

    protected void activate​(org.apache.sling.resourcemerger.impl.picker.ResourceTypeHierarchyBasedResourcePicker.Configuration config)