Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
ComponentModifier |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright 2007 The Kuali Foundation | |
3 | * | |
4 | * Licensed under the Educational Community License, Version 1.0 (the "License"); | |
5 | * you may not use this file except in compliance with the License. | |
6 | * You may obtain a copy of the License at | |
7 | * | |
8 | * http://www.opensource.org/licenses/ecl1.php | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software | |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | * See the License for the specific language governing permissions and | |
14 | * limitations under the License. | |
15 | */ | |
16 | package org.kuali.rice.krad.uif.modifier; | |
17 | ||
18 | import org.kuali.rice.krad.uif.container.View; | |
19 | import org.kuali.rice.krad.uif.core.Component; | |
20 | import org.kuali.rice.krad.uif.core.Ordered; | |
21 | ||
22 | import java.io.Serializable; | |
23 | import java.util.Set; | |
24 | ||
25 | /** | |
26 | * Provides modification functionality for a <code>Component</code> | |
27 | * | |
28 | * <p> | |
29 | * <code>ComponentModifier</code> instances are configured by the component's | |
30 | * dictionary definition. They can be used to provide dynamic initialization | |
31 | * behavior for a certain type of component or all components based on the | |
32 | * getSupportedComponents method. In addition they can do dynamic generation of | |
33 | * new <code>Component</code> instances, or replacement of the components or | |
34 | * their properties. | |
35 | * </p> | |
36 | * | |
37 | * <p> | |
38 | * Modifiers provide for more usability and flexibility of component | |
39 | * configuration. For instance if a <code>Group</code> definition is already | |
40 | * configured that is close to what the developer needs, but they need to make | |
41 | * global changes of the group, then can invoke or create a | |
42 | * <code>ComponentModifier</code> for the group to apply those changes. The | |
43 | * configuration can then inherit the exiting group definition and then specify | |
44 | * the modifier to run with the component's componentModifiers property. | |
45 | * </p> | |
46 | * | |
47 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
48 | */ | |
49 | public interface ComponentModifier extends Serializable, Ordered { | |
50 | ||
51 | /** | |
52 | * Invoked within the configured phase of the component lifecycle. This is | |
53 | * where the <code>ComponentModifier</code> should perform its work against | |
54 | * the given <code>Component</code> instance | |
55 | * | |
56 | * @param view | |
57 | * - the view instance to which the component belongs | |
58 | * @param component | |
59 | * - the component instance to modify | |
60 | */ | |
61 | public void performModification(View view, Component component); | |
62 | ||
63 | /** | |
64 | * Special version of the performModification method that takes in the model | |
65 | * as an argument. This version will be invoked if the component modifier is | |
66 | * configured to run in the applyModel or finalize phase. | |
67 | * | |
68 | * @param view | |
69 | * - the view instance to which the component belongs | |
70 | * @param model | |
71 | * - top level object containing the view data | |
72 | * @param component | |
73 | * - the component instance to modify | |
74 | * @see | |
75 | * org.kuali.rice.krad.uif.modifier.ComponentModifier.performModification | |
76 | * (View, Component) | |
77 | */ | |
78 | public void performModification(View view, Object model, Component component); | |
79 | ||
80 | /** | |
81 | * <code>Set</code> of <code>Component</code> classes that may be sent to | |
82 | * the modifier | |
83 | * | |
84 | * <p> | |
85 | * If an empty or null list is returned, it is assumed the modifier supports | |
86 | * all components. The returned set will be used by the dictionary | |
87 | * validation | |
88 | * </p> | |
89 | * | |
90 | * @return Set component classes | |
91 | */ | |
92 | public Set<Class<? extends Component>> getSupportedComponents(); | |
93 | ||
94 | /** | |
95 | * Indicates what phase of the component lifecycle the | |
96 | * <code>ComponentModifier</code> should be invoked in (INITIALIZE, | |
97 | * APPLY_MODEL, or FINALIZE) | |
98 | * | |
99 | * @return String view lifecycle phase | |
100 | * @see org.kuali.rice.krad.uif.UifConstants.ViewPhases | |
101 | */ | |
102 | public String getRunPhase(); | |
103 | ||
104 | /** | |
105 | * Conditional expression to evaluate for determining whether the component | |
106 | * modifier should be run. If the expression evaluates to true the modifier | |
107 | * will be executed, otherwise it will not be executed | |
108 | * | |
109 | * @return String el expression that should evaluate to boolean | |
110 | */ | |
111 | public String getRunCondition(); | |
112 | ||
113 | /** | |
114 | * @see org.springframework.core.Ordered#getOrder() | |
115 | */ | |
116 | public int getOrder(); | |
117 | ||
118 | /** | |
119 | * @see org.kuali.rice.krad.uif.core.Ordered#setOrder(int) | |
120 | */ | |
121 | public void setOrder(int order); | |
122 | ||
123 | } |