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.internal.services;
16:
17: import org.apache.tapestry.internal.InternalComponentResources;
18: import org.apache.tapestry.model.ComponentModel;
19: import org.apache.tapestry.runtime.Component;
20:
21: /**
22: * An object that can instantiate a component. This is used with transformed classes, in which the
23: * normal no-arguments constructor has been replaced with a constructor with arguments; the
24: * instantiator will retain the necessary arguments and pass them to the enhanced class'
25: * constructor.
26: */
27: public interface Instantiator {
28: /**
29: * Instantiates and returns a new instance of the desired class. Component classes are always
30: * modified so that they implement {@link Component} (and often, other interfaces as
31: * well).
32: */
33: Component newInstance(InternalComponentResources resources);
34:
35: /** Returns the model that defines the behavior of the component. */
36: ComponentModel getModel();
37: }
|