Interface MapEntriesHandler
-
- All Known Implementing Classes:
MapEntries
public interface MapEntriesHandler
Exposes low-level methods used for resource resolving and mappingThis 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 MapEntriesHandler
EMPTY
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull Map<String,Collection<String>>
getAliasMap(@NotNull String parentPath)
Returns all alias entries for children of the specifiedparentPath
@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 mappingsboolean
isOptimizeAliasResolutionEnabled()
Whether alias resolution optimization is enabled.void
logDisableAliasOptimization()
Log an error if alias optimization should be used but is currently disabled
-
-
-
Field Detail
-
EMPTY
static final MapEntriesHandler EMPTY
-
-
Method Detail
-
isOptimizeAliasResolutionEnabled
boolean isOptimizeAliasResolutionEnabled()
Whether alias resolution optimization is enabled. If it is enabledgetAliasMap(String)
can be used.
-
logDisableAliasOptimization
void logDisableAliasOptimization()
Log an error if alias optimization should be used but is currently disabled
-
getAliasMap
@NotNull @NotNull Map<String,Collection<String>> getAliasMap(@NotNull @NotNull String parentPath)
Returns all alias entries for children of the specifiedparentPath
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
-
getResolveMapsIterator
@NotNull @NotNull Iterator<MapEntry> getResolveMapsIterator(@NotNull @NotNull String requestPath)
Creates an iterator over the possibly applicable mapping entries for resolving a resourceThis 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.
- Returns:
- the map entry iterator
-
getMapMaps
@NotNull @NotNull Collection<MapEntry> getMapMaps()
Return a flat listing of map entries used for mapping resources to URLsThis 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 resourcesThis 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
-
-