org.apache.tapestry.services.impl
Class ComponentMessagesSourceImpl

java.lang.Object
  extended by org.apache.tapestry.services.impl.ComponentMessagesSourceImpl
All Implemented Interfaces:
EventListener, ResetEventListener, ComponentMessagesSource

public class ComponentMessagesSourceImpl
extends Object
implements ComponentMessagesSource, ResetEventListener

Service used to access localized properties for a component.

Since:
2.0.4
Author:
Howard Lewis Ship

Field Summary
static String MESSAGES_ENCODING_PROPERTY_NAME
          The name of the component/application/etc property that will be used to determine the encoding to use when loading the messages.
static String NAMESPACE_PROPERTIES_NAME
          The alternate file name of a namespace properties file to lookup.
 
Constructor Summary
ComponentMessagesSourceImpl()
           
 
Method Summary
protected  Properties getLocalizedProperties(IComponent component)
          Returns an instance of Properties containing the properly localized messages for the component, in the Locale identified by the component's containing page.
 org.apache.hivemind.Messages getMessages(IComponent component)
          Gets the associated localized component messages.
 void resetEventDidOccur()
          Clears the cache of read properties files.
 void setClasspathResourceFactory(ClasspathResourceFactory factory)
           
 void setComponentPropertySource(ComponentPropertySource componentPropertySource)
           
 void setComponentResourceResolver(IComponentResourceResolver resourceResolver)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MESSAGES_ENCODING_PROPERTY_NAME

public static final String MESSAGES_ENCODING_PROPERTY_NAME
The name of the component/application/etc property that will be used to determine the encoding to use when loading the messages.

See Also:
Constant Field Values

NAMESPACE_PROPERTIES_NAME

public static final String NAMESPACE_PROPERTIES_NAME
The alternate file name of a namespace properties file to lookup. Can be used to override the default behaviour which is to look for a <namespace name>.properties file to find localized/global properties.

See Also:
Constant Field Values
Constructor Detail

ComponentMessagesSourceImpl

public ComponentMessagesSourceImpl()
Method Detail

getLocalizedProperties

protected Properties getLocalizedProperties(IComponent component)
Returns an instance of Properties containing the properly localized messages for the component, in the Locale identified by the component's containing page.

Parameters:
component - The component to get properties for.
Returns:
A new Properties instance representing the localized properties for the specified component.

resetEventDidOccur

public void resetEventDidOccur()
Clears the cache of read properties files.

Specified by:
resetEventDidOccur in interface ResetEventListener

getMessages

public org.apache.hivemind.Messages getMessages(IComponent component)
Description copied from interface: ComponentMessagesSource
Gets the associated localized component messages.

Specified by:
getMessages in interface ComponentMessagesSource
Parameters:
component - The component to get properties for.
Returns:
The Messages for the specified component.

setComponentPropertySource

public void setComponentPropertySource(ComponentPropertySource componentPropertySource)

setClasspathResourceFactory

public void setClasspathResourceFactory(ClasspathResourceFactory factory)

setComponentResourceResolver

public void setComponentResourceResolver(IComponentResourceResolver resourceResolver)


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.