Class DescriptorLocaleExtractor

java.lang.Object
org.craftercms.search.locale.impl.DescriptorLocaleExtractor
All Implemented Interfaces:
LocaleExtractor

public class DescriptorLocaleExtractor extends Object implements LocaleExtractor
Implementation of LocaleExtractor for XML descriptors
Since:
4.0.0
Author:
joseross
  • Field Details

    • contentStoreService

      protected org.craftercms.core.service.ContentStoreService contentStoreService
      The content store service
    • localeXPath

      protected String localeXPath
      The XPath to extract the locale from the descriptor
  • Constructor Details

    • DescriptorLocaleExtractor

      @ConstructorProperties({"contentStoreService","localeXPath"}) public DescriptorLocaleExtractor(org.craftercms.core.service.ContentStoreService contentStoreService, String localeXPath)
  • Method Details

    • extract

      public Locale extract(org.craftercms.core.service.Context context, String path)
      Description copied from interface: LocaleExtractor
      Extract the locale for the given file
      Specified by:
      extract in interface LocaleExtractor
      Parameters:
      context - the current context
      path - the path of the file
      Returns:
      the locale