Package org.apache.sling.resourceresolver.impl.mapping

# Interface MapEntriesHandler

All Known Implementing Classes:
  `MapEntries`

public interface MapEntriesHandler
Exposes low-level methods used for resource resolving and mapping

This interface is intended for bundle internal use and its main goal is to prevent accidental modifications of the internal state by only exposing accessor methods.

See Also:
  - `ResourceMapper`
  - `ResourceResolver.map(String)`
  - `ResourceResolver.map(javax.servlet.http.HttpServletRequest, String)`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final MapEntriesHandler`
`EMPTY`

## Method Summary

Modifier and Type
Method
Description
`@NotNull Map<String,Collection<String>>`
`getAliasMap(@NotNull String parentPath)`
Returns all alias entries for children of the specified `parentPath`
`@NotNull Map<String,Collection<String>>`
`getAliasMap(@NotNull org.apache.sling.api.resource.Resource parent)`
`@NotNull Collection<MapEntry>`
`getMapMaps()`
Return a flat listing of map entries used for mapping resources to URLs
`@NotNull List<MapEntry>`
`getResolveMaps()`
Creates a flat listing of all the map entries used for resolving URLs to resources
`@NotNull Iterator<MapEntry>`
`getResolveMapsIterator(@NotNull String requestPath)`
Creates an iterator over the possibly applicable mapping entries for resolving a resource
`@NotNull Map<String,List<String>>`
`getVanityPathMappings()`
Returns vanity paths mappings

## Field Details

### EMPTY

static final MapEntriesHandler EMPTY

## Method Details

### getAliasMap

@NotNull @NotNull Map<String,Collection<String>> getAliasMap(@NotNull @NotNull String parentPath)
Returns all alias entries for children of the specified `parentPath`

The returned map has resource names as keys and the assigned aliases as values.

Parameters:
  `parentPath` - the parent path
Returns:
  a map of all child alias entries, possibly empty

### getAliasMap

@NotNull @NotNull Map<String,Collection<String>> getAliasMap(@NotNull @NotNull org.apache.sling.api.resource.Resource parent)

### getResolveMapsIterator

@NotNull @NotNull Iterator<MapEntry> getResolveMapsIterator(@NotNull @NotNull String requestPath)
Creates an iterator over the possibly applicable mapping entries for resolving a resource

This method uses the request path to filter out any unapplicable mapping entries and is therefore preferrable over `getResolveMaps()`.

The iterator will iterate over the mapping entries in the order of the pattern length.

Parameters:
  `requestPath` - the requestPath
Returns:
  the map entry iterator

### getMapMaps

@NotNull @NotNull Collection<MapEntry> getMapMaps()
Return a flat listing of map entries used for mapping resources to URLs

This method returns information about all mapping rules. Note that vanity paths are excluded.

Returns:
  an unmodifiable collection of map entries

### getResolveMaps

@NotNull @NotNull List<MapEntry> getResolveMaps()
Creates a flat listing of all the map entries used for resolving URLs to resources

This method returns information about all resolve rules, such as vanity paths, mapping entries, virtual URLs and URL mappings.

This list is computed on-demand and therefore should not be used in performance-critical code.

Returns:
  an unmodifiable, sorted, list of resolution map entries

### getVanityPathMappings

@NotNull @NotNull Map<String,List<String>> getVanityPathMappings()
Returns vanity paths mappings

The keys in the map are resource paths and the values are the vanity mappings.

Returns:
  an unmodifiable list of vanity path mappings