org.apache.tapestry.services.impl
Class ComponentPropertySourceImpl

java.lang.Object
  extended by org.apache.tapestry.services.impl.ComponentPropertySourceImpl
All Implemented Interfaces:
java.util.EventListener, ResetEventListener, ComponentPropertySource

public class ComponentPropertySourceImpl
extends java.lang.Object
implements ComponentPropertySource, ResetEventListener

Implementation of tapestry.props.ComponentPropertySource.

TODO: Figure out a testing strategy for this beast!

Since:
4.0
Author:
Howard M. Lewis Ship

Constructor Summary
ComponentPropertySourceImpl()
           
 
Method Summary
 java.lang.String getComponentProperty(IComponent component, java.lang.String propertyName)
          Returns the property value for a particular named meta-data property of the component.
 java.lang.String getLocalizedComponentProperty(IComponent component, java.util.Locale locale, java.lang.String propertyName)
          Like ComponentPropertySource.getComponentProperty(IComponent, String), but the property name will be localized to the component's current locale (determined from its page).
 java.lang.String getLocalizedNamespaceProperty(INamespace namespace, java.util.Locale locale, java.lang.String propertyName)
          As with ComponentPropertySource.getLocalizedComponentProperty(IComponent, Locale, String), but with a INamespace.
 java.lang.String getNamespaceProperty(INamespace namespace, java.lang.String propertyName)
          Returns the property value for a particular named meta-data property of the namespace.
 void resetEventDidOccur()
           
 void setChainBuilder(org.apache.hivemind.lib.chain.ChainBuilder chainBuilder)
           
 void setGlobalProperties(IPropertySource globalProperties)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentPropertySourceImpl

public ComponentPropertySourceImpl()
Method Detail

resetEventDidOccur

public void resetEventDidOccur()
Specified by:
resetEventDidOccur in interface ResetEventListener

getComponentProperty

public java.lang.String getComponentProperty(IComponent component,
                                             java.lang.String propertyName)
Description copied from interface: ComponentPropertySource
Returns the property value for a particular named meta-data property of the component. The search order is:

Specified by:
getComponentProperty in interface ComponentPropertySource
Returns:
the value of the given key, or null if not found.

getLocalizedComponentProperty

public java.lang.String getLocalizedComponentProperty(IComponent component,
                                                      java.util.Locale locale,
                                                      java.lang.String propertyName)
Description copied from interface: ComponentPropertySource
Like ComponentPropertySource.getComponentProperty(IComponent, String), but the property name will be localized to the component's current locale (determined from its page). Localizing the property name means that a suffix may be appended to it. If the fully localized name is not found, then the locale is generalized (i.e., from "en_UK" to "en" to nothing) until a match is found.

Specified by:
getLocalizedComponentProperty in interface ComponentPropertySource
Returns:
the value of the given property name, or null if not found.

getNamespaceProperty

public java.lang.String getNamespaceProperty(INamespace namespace,
                                             java.lang.String propertyName)
Description copied from interface: ComponentPropertySource
Returns the property value for a particular named meta-data property of the namespace. The search order is:

Specified by:
getNamespaceProperty in interface ComponentPropertySource
Returns:
the value of the given key, or null if not found.

getLocalizedNamespaceProperty

public java.lang.String getLocalizedNamespaceProperty(INamespace namespace,
                                                      java.util.Locale locale,
                                                      java.lang.String propertyName)
Description copied from interface: ComponentPropertySource
As with ComponentPropertySource.getLocalizedComponentProperty(IComponent, Locale, String), but with a INamespace.

Specified by:
getLocalizedNamespaceProperty in interface ComponentPropertySource

setChainBuilder

public void setChainBuilder(org.apache.hivemind.lib.chain.ChainBuilder chainBuilder)

setGlobalProperties

public void setGlobalProperties(IPropertySource globalProperties)