|
|||||||||||||||||||
30 day Evaluation License registered to hlship@comcast.net Your 30 day evaluation period has expired. Please visit http://www.cenqua.com to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
SpecFactory.java | - | 86.7% | 86.7% | 86.7% |
|
1 | // Copyright 2004, 2005 The Apache Software Foundation | |
2 | // | |
3 | // Licensed under the Apache License, Version 2.0 (the "License"); | |
4 | // you may not use this file except in compliance with the License. | |
5 | // You may obtain a copy of the License at | |
6 | // | |
7 | // http://www.apache.org/licenses/LICENSE-2.0 | |
8 | // | |
9 | // 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.spec; | |
16 | ||
17 | import org.apache.hivemind.ClassResolver; | |
18 | import org.apache.tapestry.bean.BindingBeanInitializer; | |
19 | import org.apache.tapestry.bean.ExpressionBeanInitializer; | |
20 | import org.apache.tapestry.bean.IBeanInitializer; | |
21 | import org.apache.tapestry.bean.MessageBeanInitializer; | |
22 | import org.apache.tapestry.binding.BindingSource; | |
23 | import org.apache.tapestry.coerce.ValueConverter; | |
24 | import org.apache.tapestry.services.ExpressionEvaluator; | |
25 | ||
26 | /** | |
27 | * A Factory used by {@link org.apache.tapestry.parse.SpecificationParser} to create Tapestry | |
28 | * domain objects. | |
29 | * <p> | |
30 | * The default implementation here creates the expected runtime instances of classes in packages: | |
31 | * <ul> | |
32 | * <li>org.apache.tapestry.spec</li> | |
33 | * <li>org.apache.tapestry.bean</li> | |
34 | * </ul> | |
35 | * <p> | |
36 | * This class is extended by Spindle - the Eclipse Plugin for Tapestry | |
37 | * | |
38 | * @author GWL | |
39 | * @since 1.0.9 | |
40 | */ | |
41 | ||
42 | public class SpecFactory | |
43 | { | |
44 | /** | |
45 | * Creates a concrete instance of {@link ApplicationSpecification}. | |
46 | */ | |
47 | ||
48 | 41 | public IApplicationSpecification createApplicationSpecification() |
49 | { | |
50 | 41 | return new ApplicationSpecification(); |
51 | } | |
52 | ||
53 | /** | |
54 | * Creates an instance of {@link LibrarySpecification}. | |
55 | * | |
56 | * @since 2.2 | |
57 | */ | |
58 | ||
59 | 65 | public ILibrarySpecification createLibrarySpecification() |
60 | { | |
61 | 65 | return new LibrarySpecification(); |
62 | } | |
63 | ||
64 | /** | |
65 | * Returns a new instance of {@link IAssetSpecification}. | |
66 | * | |
67 | * @since 3.0 | |
68 | */ | |
69 | ||
70 | 44 | public IAssetSpecification createAssetSpecification() |
71 | { | |
72 | 44 | return new AssetSpecification(); |
73 | } | |
74 | ||
75 | /** | |
76 | * Creates a new instance of {@link IBeanSpecification}. | |
77 | * | |
78 | * @since 3.0 | |
79 | */ | |
80 | ||
81 | 35 | public IBeanSpecification createBeanSpecification() |
82 | { | |
83 | 35 | return new BeanSpecification(); |
84 | } | |
85 | ||
86 | 356 | public IBindingSpecification createBindingSpecification() |
87 | { | |
88 | 356 | return new BindingSpecification(); |
89 | } | |
90 | ||
91 | /** | |
92 | * Creates a new concrete instance of {@link IListenerBindingSpecification}for the given | |
93 | * language (which is option) and script. | |
94 | * | |
95 | * @since 3.0 | |
96 | */ | |
97 | ||
98 | 4 | public IListenerBindingSpecification createListenerBindingSpecification() |
99 | { | |
100 | 4 | return new ListenerBindingSpecification(); |
101 | } | |
102 | ||
103 | /** | |
104 | * Creates a concrete instance of {@link IComponentSpecification}. | |
105 | */ | |
106 | ||
107 | 440 | public IComponentSpecification createComponentSpecification() |
108 | { | |
109 | 440 | return new ComponentSpecification(); |
110 | } | |
111 | ||
112 | /** | |
113 | * Creates a concrete instance of {@link IContainedComponent}. | |
114 | */ | |
115 | ||
116 | 273 | public IContainedComponent createContainedComponent() |
117 | { | |
118 | 273 | return new ContainedComponent(); |
119 | } | |
120 | ||
121 | /** | |
122 | * Creates a concrete instance of {@link ParameterSpecification}. | |
123 | */ | |
124 | ||
125 | 1101 | public IParameterSpecification createParameterSpecification() |
126 | { | |
127 | 1101 | return new ParameterSpecification(); |
128 | } | |
129 | ||
130 | /** | |
131 | * Creates a new instance of {@link ExpressionBeanInitializer}. | |
132 | * | |
133 | * @since 3.0 | |
134 | */ | |
135 | ||
136 | 0 | public IBeanInitializer createExpressionBeanInitializer(ExpressionEvaluator evaluator) |
137 | { | |
138 | 0 | return new ExpressionBeanInitializer(evaluator); |
139 | } | |
140 | ||
141 | /** @since 4.0 */ | |
142 | 9 | public BindingBeanInitializer createBindingBeanInitializer(BindingSource source) |
143 | { | |
144 | 9 | return new BindingBeanInitializer(source); |
145 | } | |
146 | ||
147 | /** | |
148 | * Returns a new instance of {@link MessageBeanInitializer}. | |
149 | * | |
150 | * @since 3.0 | |
151 | */ | |
152 | ||
153 | 0 | public IBeanInitializer createMessageBeanInitializer() |
154 | { | |
155 | 0 | return new MessageBeanInitializer(); |
156 | } | |
157 | ||
158 | /** | |
159 | * Creates a concrete instance of {@link org.apache.tapestry.spec.IExtensionSpecification}. | |
160 | * | |
161 | * @since 2.2 | |
162 | */ | |
163 | ||
164 | 10 | public IExtensionSpecification createExtensionSpecification(ClassResolver resolver, |
165 | ValueConverter valueConverter) | |
166 | { | |
167 | 10 | return new ExtensionSpecification(resolver, valueConverter); |
168 | } | |
169 | ||
170 | /** | |
171 | * Creates a concrete instance of {@link org.apache.tapestry.spec.IPropertySpecification}. | |
172 | * | |
173 | * @since 3.0 | |
174 | */ | |
175 | ||
176 | 123 | public IPropertySpecification createPropertySpecification() |
177 | { | |
178 | 123 | return new PropertySpecification(); |
179 | } | |
180 | ||
181 | /** @since 4.0 */ | |
182 | 374 | public InjectSpecification createInjectSpecification() |
183 | { | |
184 | 374 | return new InjectSpecificationImpl(); |
185 | } | |
186 | } |
|