01: // Copyright 2006 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.Binding;
18: import org.apache.tapestry.ComponentResources;
19: import org.apache.tapestry.ioc.Location;
20:
21: /**
22: * Creates a binding of a particular type.
23: */
24: public interface BindingFactory {
25: /**
26: * Creates a new binding instance.
27: * <p>
28: * The binding represents a connection between the container and the component (the component is
29: * usually the child of the component, though in a few cases, it is the component itself). In
30: * most cases, the expression is evaluated in terms of the resources of the <em>container</em>
31: * and the component is ignored.
32: *
33: * @param description
34: * of the binding, such as, "parameter foo"
35: * @param container
36: * the component, as represented by its resources, for which a binding is to be
37: * created.
38: * @param component
39: * the component whose parameter is to be bound by the resulting binding (rarely
40: * used)
41: * @param expression
42: * @param location
43: * from which the binding was generate, or null if not known
44: * @return the new binding instance
45: */
46: Binding newBinding(String description,
47: ComponentResources container, ComponentResources component,
48: String expression, Location location);
49: }
|