org.kuali.rice.kns.uif.modifier
Interface ComponentModifier

All Superinterfaces:
org.springframework.core.Ordered, Serializable
All Known Implementing Classes:
CompareFieldCreateModifier, ComponentConvertModifier, ComponentModifierBase, LabelFieldSeparateModifier

public interface ComponentModifier
extends Serializable, Ordered

Provides modification functionality for a Component

ComponentModifier instances are configured by the component's dictionary definition. They can be used to provide dynamic initialization behavior for a certain type of component or all components based on the getSupportedComponents method. In addition they can do dynamic generation of new Component instances, or replacement of the components or their properties.

Modifiers provide for more usability and flexibility of component configuration. For instance if a Group definition is already configured that is close to what the developer needs, but they need to make global changes of the group, then can invoke or create a ComponentModifier for the group to apply those changes. The configuration can then inherit the exiting group definition and then specify the modifier to run with the component's componentModifiers property.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Field Summary
 
Fields inherited from interface org.kuali.rice.kns.uif.core.Ordered
INITIAL_ORDER_VALUE
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Method Summary
 int getOrder()
           
 String getRunCondition()
          Conditional expression to evaluate for determining whether the component modifier should be run.
 String getRunPhase()
          Indicates what phase of the component lifecycle the ComponentModifier should be invoked in (INITIALIZE, APPLY_MODEL, or FINALIZE)
 Set<Class<? extends Component>> getSupportedComponents()
          Set of Component classes that may be sent to the modifier
 void performModification(View view, Component component)
          Invoked within the configured phase of the component lifecycle.
 void performModification(View view, Object model, Component component)
          Special version of the performModification method that takes in the model as an argument.
 void setOrder(int order)
          Setter for the order value
 

Method Detail

performModification

void performModification(View view,
                         Component component)
Invoked within the configured phase of the component lifecycle. This is where the ComponentModifier should perform its work against the given Component instance

Parameters:
view - - the view instance to which the component belongs
component - - the component instance to modify

performModification

void performModification(View view,
                         Object model,
                         Component component)
Special version of the performModification method that takes in the model as an argument. This version will be invoked if the component modifier is configured to run in the applyModel or finalize phase.

Parameters:
view - - the view instance to which the component belongs
model - - top level object containing the view data
component - - the component instance to modify
See Also:
(View, Component)

getSupportedComponents

Set<Class<? extends Component>> getSupportedComponents()
Set of Component classes that may be sent to the modifier

If an empty or null list is returned, it is assumed the modifier supports all components. The returned set will be used by the dictionary validation

Returns:
Set component classes

getRunPhase

String getRunPhase()
Indicates what phase of the component lifecycle the ComponentModifier should be invoked in (INITIALIZE, APPLY_MODEL, or FINALIZE)

Returns:
String view lifecycle phase
See Also:
UifConstants.ViewPhases

getRunCondition

String getRunCondition()
Conditional expression to evaluate for determining whether the component modifier should be run. If the expression evaluates to true the modifier will be executed, otherwise it will not be executed

Returns:
String el expression that should evaluate to boolean

getOrder

int getOrder()
Specified by:
getOrder in interface org.springframework.core.Ordered
See Also:
Ordered.getOrder()

setOrder

void setOrder(int order)
Description copied from interface: Ordered
Setter for the order value

See Also:
Ordered.setOrder(int)


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.