Class CandidateTargetIdsResolverImpl
java.lang.Object
org.craftercms.engine.targeting.impl.CandidateTargetIdsResolverImpl
- All Implemented Interfaces:
CandidateTargetIdsResolver
Default implementation of
CandidateTargetIdsResolver
, which generates the candidate target IDs by splitting
the original target ID and appending the components again but excluding the last one on each iteration. For example,
if the original target ID is ja_JP_JP and the fallback target ID is en, the the candidate targetd IDs will be:
ja_JP_JP, ja_JP, ja and en.- Author:
- avasquez
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetTargetIds
(String targetId, String fallbackTargetId) Resolves the target IDs to use to build the candidate targeted URLs.void
setTargetIdSeparator
(String targetIdSeparator)
-
Field Details
-
DEFAULT_TARGET_ID_SEPARATOR
- See Also:
-
targetIdSeparator
-
-
Constructor Details
-
CandidateTargetIdsResolverImpl
public CandidateTargetIdsResolverImpl()
-
-
Method Details
-
setTargetIdSeparator
-
getTargetIds
Description copied from interface:CandidateTargetIdsResolver
Resolves the target IDs to use to build the candidate targeted URLs. For example, if the specified target ID is es_CR, and the fallback target ID is en, then the candidate target IDs are: es_CR, es and en. An empty string will be added if the fallback target ID is empty or null.- Specified by:
getTargetIds
in interfaceCandidateTargetIdsResolver
- Parameters:
targetId
- the target ID from where to resolve the candidate target IDsfallbackTargetId
- the last candidate target ID to use- Returns:
- the list of candidate target IDs
-