Package org.pentaho.platform.util.beans
Class ActionHarness
- java.lang.Object
-
- org.pentaho.platform.util.beans.BeanUtil
-
- org.pentaho.platform.util.beans.ActionHarness
-
public class ActionHarness extends BeanUtil
A utility for consistent interaction withIAction
s. Based onBeanUtil
, but with logic specific toIAction
beans. One such behavior is the setting of pass-through properties to anIVarArgsAction
. Note that all the setValue and setValues methods will properly handleIVarArgsAction
s if the bean is of this type.- Author:
- aphillips
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ActionHarness.DefaultActionCallback
static class
ActionHarness.VarArgsWrapperCallback
-
Nested classes/interfaces inherited from class org.pentaho.platform.util.beans.BeanUtil
BeanUtil.EagerFailingCallback, BeanUtil.FeedbackValueGenerator
-
-
Field Summary
-
Fields inherited from class org.pentaho.platform.util.beans.BeanUtil
bean, defaultCallback
-
-
Constructor Summary
Constructors Constructor Description ActionHarness(org.pentaho.platform.api.action.IAction actionBean)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setValue(String propertyName, Object value, ValueSetErrorCallback callback, PropertyNameFormatter... formatters)
Performs same function as the super, with the added feature of granting undeclared properties to the action bean if it is aIVarArgsAction
.-
Methods inherited from class org.pentaho.platform.util.beans.BeanUtil
getPropertyType, getValue, isReadable, isWriteable, setDefaultCallback, setValue, setValue, setValue, setValues, setValues, setValues
-
-
-
-
Method Detail
-
setValue
public void setValue(String propertyName, Object value, ValueSetErrorCallback callback, PropertyNameFormatter... formatters) throws Exception
Performs same function as the super, with the added feature of granting undeclared properties to the action bean if it is aIVarArgsAction
.Set a bean property with a given value, allowing the caller to respond to various error states that may be encountered during the attempt to set the value on the bean. This method also allows the caller to specify formatters that will modify the property name to match what the bean expects as the true name of the property. This can be helpful when you are trying to map parameters from a source that follows a convention that is not Java Bean spec compliant.
- Overrides:
setValue
in classBeanUtil
- Parameters:
propertyName
- the bean property to setvalue
- the value to set on the bean. If value is an instance ofValueGenerator
, then the value will be derived by callingValueGenerator.getValue(String)
. Note: if value isnull
, we consciously bypass the set operation altogether since it leads to indeterminate behavior, i.e. it may fail or succeed.callback
- a structure that alerts the caller of any error states and enables the caller to fail, log, proceed, etcformatters
- a list of objects that can be used to modify the given property name prior to performing any operations on the bean itself. This new formatted property name will be used to identify the bean property. bean lookup and value setting- Throws:
Exception
- when something goes wrong (controlled by the callback object)- See Also:
ValueGenerator
,ValueSetErrorCallback
,PropertyNameFormatter
-
-