01: // Copyright 2007 The Apache Software Foundation
02: //
03: // Licensed under the Apache License, Version 2.0 (the "License");
04: // you may not use this file except in compliance with the License.
05: // You may obtain a copy of the License at
06: //
07: // http://www.apache.org/licenses/LICENSE-2.0
08: //
09: // Unless required by applicable law or agreed to in writing, software
10: // distributed under the License is distributed on an "AS IS" BASIS,
11: // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: // See the License for the specific language governing permissions and
13: // limitations under the License.
14:
15: package org.apache.tapestry.services;
16:
17: import org.apache.tapestry.ComponentResources;
18: import org.apache.tapestry.model.ComponentModel;
19:
20: /**
21: * Used to lookup meta data concerning a particular component. The primary source of meta data is
22: * the meta data defined for the component, accessed via {@link ComponentModel#getMeta(String)}.
23: * This includes meta data defined by base classes. When meta-data for a particular component can
24: * not be found, a search works up the containment hierarchy (to the component's container, and the
25: * container's containter, and so on). If <em>that</em> proves unfruitful, a system of defaults is
26: * provided by configuration and matched against the containing page's logical name.
27: */
28: public interface MetaDataLocator {
29: /**
30: * Searches for the value for the corresponding key.
31: *
32: * @param key
33: * the key used to locate the meta data (case insensitive)
34: * @param resources
35: * the resources of the initial component used in the search
36: * @return the value if found (in the component, the component's container, etc. or via a folder
37: * default) or null if not found anywhere
38: */
39: String findMeta(String key, ComponentResources resources);
40: }
|