Class ResourcesLabelLocator

  • All Implemented Interfaces:
    org.zkoss.util.resource.LabelLocator2

    public class ResourcesLabelLocator
    extends java.lang.Object
    implements org.zkoss.util.resource.LabelLocator2
    Label locator loading labels from resources. To activate and configure add a spring bean to your web spring xml file like this: <bean id="myLabelLocator" class="com.hybris.cockpitng.util.labels.ResourcesLabelLocator" scope="singleton" init-method="init" lazy-init="false"> <property name="location" value="/my/path/in/resources/labels"/> <property name="name" value="labels"/> </bean>
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getCharset()
      Returns "UTF-8".
      void init()
      Registers this label locator.
      java.io.InputStream locate​(java.util.Locale locale)  
      void setLocation​(java.lang.String location)
      Sets the location of the localization files in resources.
      void setName​(java.lang.String name)
      Sets the prefix of the label files.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ResourcesLabelLocator

        public ResourcesLabelLocator()
    • Method Detail

      • init

        public void init()
        Registers this label locator. Should be specified as init-method if this will be registered as a spring bean.
      • setLocation

        public void setLocation​(java.lang.String location)
        Sets the location of the localization files in resources. It must point to the package which contain the files. Example: '/my/path/in/resources/labels'.
        Parameters:
        location - location of the localization files within resources (a package)
      • setName

        public void setName​(java.lang.String name)
        Sets the prefix of the label files. Will be used to locate the labels files in the specified location (@see setLocation(String)). For example: setting the name to 'labels' will look for files with naming scheme labels_.properties where is the code of the current locale. (The default fallback file will be labels.properties in this case.)
        Parameters:
        name - prefix of the label files
      • locate

        public java.io.InputStream locate​(java.util.Locale locale)
        Specified by:
        locate in interface org.zkoss.util.resource.LabelLocator2
      • getCharset

        public java.lang.String getCharset()
        Returns "UTF-8".
        Specified by:
        getCharset in interface org.zkoss.util.resource.LabelLocator2