Class LocaleTargetIdManager
- java.lang.Object
-
- org.craftercms.engine.targeting.impl.AbstractTargetIdManager
-
- org.craftercms.engine.targeting.impl.LocaleTargetIdManager
-
- All Implemented Interfaces:
TargetIdManager
public class LocaleTargetIdManager extends AbstractTargetIdManager
Implementation ofTargetIdManager
that treats theLocale
as a target ID. The current target ID is one returned byLocaleContextHolder.getLocale()
, and if no available target IDs are specified in the site configuration, the available locales of the JVM will be used instead. The locales are always converted lower case.- Author:
- avasquez
-
-
Constructor Summary
Constructors Constructor Description LocaleTargetIdManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<String>
getAvailableTargetIds()
Returns the available target IDs defined in the current site configuration.String
getCurrentTargetId()
Returns the target ID for the current request, or null or empty if there's no target ID.-
Methods inherited from class org.craftercms.engine.targeting.impl.AbstractTargetIdManager
getFallbackTargetId
-
-
-
-
Method Detail
-
getCurrentTargetId
public String getCurrentTargetId() throws IllegalStateException
Description copied from interface:TargetIdManager
Returns the target ID for the current request, or null or empty if there's no target ID.- Throws:
IllegalStateException
-
getAvailableTargetIds
public List<String> getAvailableTargetIds()
Description copied from class:AbstractTargetIdManager
Returns the available target IDs defined in the current site configuration. If not defined, andIllegalStateException
is thrown.- Specified by:
getAvailableTargetIds
in interfaceTargetIdManager
- Overrides:
getAvailableTargetIds
in classAbstractTargetIdManager
-
-