| 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.kns.uif.modifier; | |
| 17 | ||
| 18 | import java.io.Serializable; | |
| 19 | import java.util.Set; | |
| 20 | ||
| 21 | import org.kuali.rice.kns.uif.container.View; | |
| 22 | import org.kuali.rice.kns.uif.core.Component; | |
| 23 | import org.kuali.rice.kns.uif.core.Ordered; | |
| 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 | * <code>Set</code> of <code>Component</code> classes that may be sent to | |
| 65 | * the modifier | |
| 66 | * | |
| 67 | * <p> | |
| 68 | * If an empty or null list is returned, it is assumed the modifier supports | |
| 69 | * all components. The returned set will be used by the dictionary | |
| 70 | * validation | |
| 71 | * </p> | |
| 72 | * | |
| 73 | * @return Set component classes | |
| 74 | */ | |
| 75 | public Set<Class<? extends Component>> getSupportedComponents(); | |
| 76 | ||
| 77 | /** | |
| 78 | * Indicates what phase of the component lifecycle the | |
| 79 | * <code>ComponentModifier</code> should be invoked in (INITIALIZE, | |
| 80 | * APPLY_MODEL, or FINALIZE) | |
| 81 | * | |
| 82 | * @return String view lifecycle phase | |
| 83 | * @see org.kuali.rice.kns.uif.UifConstants.ViewPhases | |
| 84 | */ | |
| 85 | public String getRunPhase(); | |
| 86 | ||
| 87 | /** | |
| 88 | * Conditional expression to evaluate for determining whether the component | |
| 89 | * modifier should be run. If the expression evaluates to true the modifier | |
| 90 | * will be executed, otherwise it will not be executed | |
| 91 | * | |
| 92 | * @return String el expression that should evaluate to boolean | |
| 93 | */ | |
| 94 | public String getRunCondition(); | |
| 95 | ||
| 96 | /** | |
| 97 | * @see org.springframework.core.Ordered#getOrder() | |
| 98 | */ | |
| 99 | public int getOrder(); | |
| 100 | ||
| 101 | /** | |
| 102 | * @see org.kuali.rice.kns.uif.core.Ordered#setOrder(int) | |
| 103 | */ | |
| 104 | public void setOrder(int order); | |
| 105 | ||
| 106 | } |