2009/05/20 - Apache Shale has been retired.
For more information, please explore the Attic.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.shale.test.el;
19
20 import java.beans.FeatureDescriptor;
21 import javax.el.ELResolver;
22
23 /***
24 * <p>Convenience base class for EL resolvers.</p>
25 */
26 abstract class AbstractELResolver extends ELResolver {
27
28
29
30
31
32
33 /***
34 * <p>Create and return a <code>FeatureDescriptor</code> configured with
35 * the specified arguments.</p>
36 *
37 * @param name Feature name
38 * @param displayName Display name
39 * @param description Short description
40 * @param expert Flag indicating this feature is for experts
41 * @param hidden Flag indicating this feature should be hidden
42 * @param preferred Flag indicating this feature is the preferred one
43 * among features of the same type
44 * @param type Runtime type of this feature
45 * @param designTime Flag indicating feature is resolvable at design time
46 */
47 protected FeatureDescriptor descriptor(String name, String displayName,
48 String description, boolean expert, boolean hidden, boolean preferred,
49 Object type, boolean designTime) {
50
51 FeatureDescriptor descriptor = new FeatureDescriptor();
52
53 descriptor.setName(name);
54 descriptor.setDisplayName(displayName);
55 descriptor.setShortDescription(description);
56 descriptor.setExpert(expert);
57 descriptor.setHidden(hidden);
58 descriptor.setPreferred(preferred);
59 descriptor.setValue(ELResolver.TYPE, type);
60 if (designTime) {
61 descriptor.setValue(ELResolver.RESOLVABLE_AT_DESIGN_TIME, Boolean.TRUE);
62 } else {
63 descriptor.setValue(ELResolver.RESOLVABLE_AT_DESIGN_TIME, Boolean.FALSE);
64 }
65
66 return descriptor;
67
68 }
69
70
71 }