@UsesMappedConfiguration(value=java.lang.String.class) public interface MetaDataLocator
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. Generally speaking, if you are going to use this service to look up meta data, your should
also make a contribution to the FactoryDefaults service; otherwise, you risk a runtime exception if a meta-data key
can not be resolved.Modifier and Type | Method and Description |
---|---|
<T> T |
findMeta(String key,
ComponentResources resources,
Class<T> expectedType)
Searches for the value for the corresponding key.
|
<T> T |
findMeta(String key,
String pageName,
Class<T> expectedType)
Searches for the value for the corresponding key for a particular page name (the page will not be
loaded).
|
<T> T findMeta(String key, ComponentResources resources, Class<T> expectedType)
key
- the key used to locate the meta data (case insensitive)resources
- the resources of the initial component used in the searchRuntimeException
- if the value for the key is not present as meta data of the component, as an override,
or as a symbol<T> T findMeta(String key, String pageName, Class<T> expectedType)
key
- the key used to locate the meta data (case insensitive)pageName
- the name of the page to searchRuntimeException
- if the value for the key is not present as meta data of the page, as an override, or as
a symbol${project.version} - Copyright © 2003-2015 The Apache Software Foundation.