org.zkoss.util.resource.impl
Class LabelLoader

java.lang.Object
  extended by org.zkoss.util.resource.impl.LabelLoader

public class LabelLoader
extends java.lang.Object

The label loader (implementation only). Used to implement Labels.

Notice that the encoding of i3-label.properties is assumed to be UTF-8. If it is not the case, please refer to Libraries Properties for configuration (avaible since 3.6.0).

Author:
tomyeh

Constructor Summary
LabelLoader()
           
 
Method Summary
 java.lang.String getLabel(java.lang.String key)
          Returns the label of the specified key, or null if not found.
protected  java.lang.String getProperty(java.util.Locale locale, java.lang.String key)
          Returns the property without interprets any expression.
 void register(LabelLocator locator)
          Registers a locator which is used to load i3-label*.properties from other resource, such as servlet contexts.
 void reset()
          Resets all cached labels and next call to getLabel(java.lang.String) will cause re-loading i3-label*.proerties.
 VariableResolver setVariableResolver(VariableResolver resolv)
          Sets the variable resolver, which is used if an EL expression is specified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LabelLoader

public LabelLoader()
Method Detail

getLabel

public java.lang.String getLabel(java.lang.String key)
Returns the label of the specified key, or null if not found.


setVariableResolver

public VariableResolver setVariableResolver(VariableResolver resolv)
Sets the variable resolver, which is used if an EL expression is specified.

Since:
3.0.0

register

public void register(LabelLocator locator)
Registers a locator which is used to load i3-label*.properties from other resource, such as servlet contexts.


reset

public void reset()
Resets all cached labels and next call to getLabel(java.lang.String) will cause re-loading i3-label*.proerties.


getProperty

protected java.lang.String getProperty(java.util.Locale locale,
                                       java.lang.String key)
Returns the property without interprets any expression. It searches properties defined in i3-label*.properties All label accesses are eventually done by this method.

To alter its behavior, you might override this method.



Copyright © 2005-2009 Potix Corporation. All Rights Reserved. SourceForge.net Logo