Class LocaleTargetIdManager
java.lang.Object
org.craftercms.engine.targeting.impl.AbstractTargetIdManager
org.craftercms.engine.targeting.impl.LocaleTargetIdManager
- All Implemented Interfaces:
TargetIdManager
Implementation of
TargetIdManager
that treats the Locale
as a
target ID. The current target ID is one returned by LocaleContextHolder.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
-
Method Summary
Modifier and TypeMethodDescriptionReturns the available target IDs defined in the current site configuration.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
-
Constructor Details
-
LocaleTargetIdManager
public LocaleTargetIdManager()
-
-
Method Details
-
getCurrentTargetId
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
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
-