org.apache.tapestry.services
Interface ComponentPropertySource

All Known Implementing Classes:
ComponentPropertySourceImpl

public interface ComponentPropertySource

Enapsulates the logic for searching for component meta-data. Deployed as service tapestry.props.ComponentPropertySource.

TODO: Adjust name, since it now provides access to namespace properties as well as component properties.

Since:
4.0
Author:
Howard M. Lewis Ship

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 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 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.
 

Method Detail

getComponentProperty

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

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)
Like 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.

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)
Returns the property value for a particular named meta-data property of the namespace. The search order is:

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)
As with getLocalizedComponentProperty(IComponent, Locale, String), but with a INamespace.