01: // Copyright 2006, 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.internal.services;
16:
17: import java.util.List;
18:
19: import org.apache.tapestry.internal.util.MultiKey;
20: import org.apache.tapestry.ioc.internal.util.IdAllocator;
21: import org.apache.tapestry.services.ClassTransformation;
22: import org.apache.tapestry.services.ComponentClassTransformWorker;
23:
24: /**
25: * Extends {@link org.apache.tapestry.services.ClassTransformation} with additional methods that may
26: * only be used internally by Tapestry.
27: */
28: public interface InternalClassTransformation extends
29: ClassTransformation {
30: /**
31: * Returns the name of the protected field that is injected with the
32: * {@link org.apache.tapestry.internal.InternalComponentResources}.
33: */
34: String getResourcesFieldName();
35:
36: /**
37: * Invoked after all {@link ComponentClassTransformWorker}s have had their chance to work over
38: * the class. This performs any final operations for the class transformation, which includes
39: * coming up with the final constructor method for the class.
40: */
41: void finish();
42:
43: /**
44: * Called (after {@link #finish()}) to construct an instantiator for the component.
45: *
46: * @param componentClass
47: * the class to be instantiated
48: * @return the component's instantiator
49: */
50: Instantiator createInstantiator(Class componentClass);
51:
52: /**
53: * Returns a copy of the transformation's IdAllocator. Used when creating a child class
54: * transformation. May only be invoked on a frozen transformation.
55: */
56: IdAllocator getIdAllocator();
57:
58: /**
59: * Returns a copy of the list of constructor arguments for this class.
60: */
61: List<ConstructorArg> getConstructorArgs();
62:
63: /**
64: * Searchs for an existing injection of an object, returning the name of the protected field
65: * into which the value was injected.
66: */
67: String searchForPreviousInjection(MultiKey key);
68: }
|