org.apache.tapestry.services
Interface MetaDataLocator
- All Known Implementing Classes:
- MetaDataLocatorImpl
public interface MetaDataLocator
Used to lookup meta data concerning a particular component. The primary source of meta data is the meta data defined
for the component, accessed via ComponentModel.getMeta(String). This includes meta
data defined by base classes. When meta-data for a particular component can not be found, a search works up the
containment hierarchy (to the component's container, and the container's container, and so on). If that
proves unfruitful, a system of defaults is provided by configuration and matched against the containing page's
logical name.
Finally, if no metadata is available, then SymbolSource.valueForSymbol(String)
is used to obtain a value.
findMeta
<T> T findMeta(String key,
ComponentResources resources,
Class<T> expectedType)
- Searches for the value for the corresponding key. The value, if located, will have symbols expanded, and will be
type coerced to the desired type.
- Parameters:
key - the key used to locate the meta data (case insensitive)resources - the resources of the initial component used in the search
- Returns:
- the value if found (in the component, the component's container, etc. or via a folder default) or null if
not found anywhere
- Throws:
RuntimeException - if the value for the key is not present as meta data of the component, as an override,
or as a symbol
Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.