nl.openedge.baritus
Class ExecutionParams

java.lang.Object
  extended bynl.openedge.baritus.ExecutionParams
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public final class ExecutionParams
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

Each instance of FormBeanBase keeps an instance of ExecutionParams. ExecutionParams are used to influence the execution of population, validation and the general execution of FormBeanBase. If you want to override the defaults, you can override method init in your controller, using getExecutionParams() to get the reference to the execution params that will be used for the instance of your controller. For more finegrained (per request) control, another option is to override method getExecutionParams() itself. This method will be called each request and by default just returns the instance variable. You can vary the processing by returning a new instance of ExecutionParams (be carefull NOT to just change values in the instance variable, as this is shared by all clients), with its properties set for that request.

Author:
Eelco Hillenius
See Also:
Serialized Form

Constructor Summary
ExecutionParams()
           
 
Method Summary
 java.lang.Object clone()
          Clone this object.
 boolean isDoFormValidationIfFieldValidationFailed()
          Indicates whether the form validators should be executed when one of the field validators failed.
 boolean isDoPerformIfPopulationFailed()
          Whether the perform method of the control should be executed, even if the population/ validation failed.
 boolean isIncludeControllerParameters()
          include controller parameters in the population process The order in which parameters/ attributes are used for population: 1. controller parameters (if includeControllerParameters == true) 2. session attributes (if includeSessionAttributes == true) 3. request parameters 4. request attributes (if includeRequestAttributes == true)
 boolean isIncludeRequestAttributes()
          include request attributes in the population process The order in which parameters/ attributes are used for population: 1. controller parameters (if includeControllerParameters == true) 2. session attributes (if includeSessionAttributes == true) 3. request parameters 4. request attributes (if includeRequestAttributes == true)
 boolean isIncludeSessionAttributes()
          include session attributes in the population process The order in which parameters/ attributes are used for population: 1. controller parameters (if includeControllerParameters == true) 2. session attributes (if includeSessionAttributes == true) 3. request parameters 4. request attributes (if includeRequestAttributes == true)
 boolean isNoCache()
          if true, the no cache headers will be set
 boolean isPopulateAndValidate()
          Get flag whether Baritus should try to populate the form bean.
 boolean isReuseFormBeanContext()
          Whether to reuse the context for multiple invocations within the same request.
 boolean isSaveReqParamsAsOverrideFieldsOnError()
          Gets whether all request parameters should be saved as override values when population or validation fails.
 boolean isSetNullForEmptyString()
          If we get an empty string it should be translated to a null (true) or to an empty String false.
 boolean isStrictPopulationMode()
          When an unexpected error occurs, should that be interpreted as a failure, or should it just be ignored.
 boolean isTrimStringInputValues()
          Get whether string input values should be trimmed before conversion.
 void setDoFormValidationIfFieldValidationFailed(boolean b)
          Indicates whether the form validators should be executed when one of the field validators failed.
 void setDoPerformIfPopulationFailed(boolean b)
          Whether the perform method of the control should be executed, even if the population/ validation failed.
 void setIncludeControllerParameters(boolean b)
          set whether to include controller parameters in the population process The order in which parameters/ attributes are used for population: 1. controller parameters (if includeControllerParameters == true) 2. session attributes (if includeSessionAttributes == true) 3. request parameters 4. request attributes (if includeRequestAttributes == true)
 void setIncludeRequestAttributes(boolean b)
          set whether to include request attributes in the population process The order in which parameters/ attributes are used for population: 1. controller parameters (if includeControllerParameters == true) 2. session attributes (if includeSessionAttributes == true) 3. request parameters 4. request attributes (if includeRequestAttributes == true)
 void setIncludeSessionAttributes(boolean b)
          set whether to include session attributes in the population process The order in which parameters/ attributes are used for population: 1. controller parameters (if includeControllerParameters == true) 2. session attributes (if includeSessionAttributes == true) 3. request parameters 4. request attributes (if includeRequestAttributes == true)
 void setNoCache(boolean noCache)
          if true, the no cache headers will be set
 void setPopulateAndValidate(boolean populateAndValidate)
          Set flag whether Baritus should try to populate the form bean.
 void setReuseFormBeanContext(boolean b)
          Set whether to reuse the context for multiple invocations within the same request.
 void setSaveReqParamsAsOverrideFieldsOnError(boolean b)
          Sets whether all request parameters should be saved as override values when population or validation fails.
 void setSetNullForEmptyString(boolean b)
          If we get an empty string it should be translated to a null (true) or to an empty String false.
 void setStrictPopulationMode(boolean b)
          When an unexpected error occurs, should that be interpreted as a failure, or should it just be ignored.
 void setTrimStringInputValues(boolean b)
          Set whether string input values should be trimmed before conversion.
 java.lang.String toString()
          String rep.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExecutionParams

public ExecutionParams()
Method Detail

isNoCache

public boolean isNoCache()
if true, the no cache headers will be set

Returns:
boolean

setNoCache

public void setNoCache(boolean noCache)
if true, the no cache headers will be set

Parameters:
noCache -

isSetNullForEmptyString

public boolean isSetNullForEmptyString()
If we get an empty string it should be translated to a null (true) or to an empty String false. This property is true by default

Returns:
boolean

setSetNullForEmptyString

public void setSetNullForEmptyString(boolean b)
If we get an empty string it should be translated to a null (true) or to an empty String false. This property is true by default

Parameters:
b -

isIncludeControllerParameters

public boolean isIncludeControllerParameters()
include controller parameters in the population process The order in which parameters/ attributes are used for population: 1. controller parameters (if includeControllerParameters == true) 2. session attributes (if includeSessionAttributes == true) 3. request parameters 4. request attributes (if includeRequestAttributes == true)

Returns:
boolean include controller parameters in the population process

setIncludeControllerParameters

public void setIncludeControllerParameters(boolean b)
set whether to include controller parameters in the population process The order in which parameters/ attributes are used for population: 1. controller parameters (if includeControllerParameters == true) 2. session attributes (if includeSessionAttributes == true) 3. request parameters 4. request attributes (if includeRequestAttributes == true)

Parameters:
b - set whether to include controller parameters in the population process

isIncludeSessionAttributes

public boolean isIncludeSessionAttributes()
include session attributes in the population process The order in which parameters/ attributes are used for population: 1. controller parameters (if includeControllerParameters == true) 2. session attributes (if includeSessionAttributes == true) 3. request parameters 4. request attributes (if includeRequestAttributes == true)

Returns:
boolean include controller parameters in the population process

setIncludeSessionAttributes

public void setIncludeSessionAttributes(boolean b)
set whether to include session attributes in the population process The order in which parameters/ attributes are used for population: 1. controller parameters (if includeControllerParameters == true) 2. session attributes (if includeSessionAttributes == true) 3. request parameters 4. request attributes (if includeRequestAttributes == true)

Parameters:
b - set whether to include session attributes in the population process

isIncludeRequestAttributes

public boolean isIncludeRequestAttributes()
include request attributes in the population process The order in which parameters/ attributes are used for population: 1. controller parameters (if includeControllerParameters == true) 2. session attributes (if includeSessionAttributes == true) 3. request parameters 4. request attributes (if includeRequestAttributes == true)

Returns:
boolean include request parameters in the population process

setIncludeRequestAttributes

public void setIncludeRequestAttributes(boolean b)
set whether to include request attributes in the population process The order in which parameters/ attributes are used for population: 1. controller parameters (if includeControllerParameters == true) 2. session attributes (if includeSessionAttributes == true) 3. request parameters 4. request attributes (if includeRequestAttributes == true)

Parameters:
b - set whether to include request attributes in the population process

isDoFormValidationIfFieldValidationFailed

public boolean isDoFormValidationIfFieldValidationFailed()
Indicates whether the form validators should be executed when one of the field validators failed. Default == true.

Returns:
boolean Whether the form validators should be executed when one of the field validators failed.

setDoFormValidationIfFieldValidationFailed

public void setDoFormValidationIfFieldValidationFailed(boolean b)
Indicates whether the form validators should be executed when one of the field validators failed. Default == true.

Parameters:
b - whether the form validators should be executed when one of the field validators failed.

isDoPerformIfPopulationFailed

public boolean isDoPerformIfPopulationFailed()
Whether the perform method of the control should be executed, even if the population/ validation failed. Use this only in very special cases; extended usage will probably result in messy code. Default == false.

Returns:
boolean whether the perform method of the control should be executed, even if the population/ validation failed.

setDoPerformIfPopulationFailed

public void setDoPerformIfPopulationFailed(boolean b)
Whether the perform method of the control should be executed, even if the population/ validation failed. Use this only in very special cases; extended usage will probably result in messy code. Default == false.

Parameters:
b - whether the perform method of the control should be executed, even if the population/ validation failed.

isReuseFormBeanContext

public boolean isReuseFormBeanContext()
Whether to reuse the context for multiple invocations within the same request. Default is true.

Returns:
reuse the context for multiple invocations within the same request

setReuseFormBeanContext

public void setReuseFormBeanContext(boolean b)
Set whether to reuse the context for multiple invocations within the same request. Default is true.

Parameters:
b - reuse the context for multiple invocations within the same request

isSaveReqParamsAsOverrideFieldsOnError

public boolean isSaveReqParamsAsOverrideFieldsOnError()
Gets whether all request parameters should be saved as override values when population or validation fails. If population or validation failes and this property is true, all request parameters will be saved as override values. This will give you at least the full request the client sent, and guards you for the situation where properties that normally would be loaded in the command method are not set because of the population/ validation failure. Default is true.

Returns:
boolean wheter all request parameters should be saved as override values when population or validation fails.

setSaveReqParamsAsOverrideFieldsOnError

public void setSaveReqParamsAsOverrideFieldsOnError(boolean b)
Sets whether all request parameters should be saved as override values when population or validation fails. If population or validation failes and this property is true, all request parameters will be saved as override values. This will give you at least the full request the client sent, and guards you for the situation where properties that normally would be loaded in the command method are not set because of the population/ validation failure. Default is true.

Parameters:
b -

isStrictPopulationMode

public boolean isStrictPopulationMode()
When an unexpected error occurs, should that be interpreted as a failure, or should it just be ignored. E.g. If you have request parameter not-a-valid-property, Ognl will throw exception 'ognl.InappropriateExpressionException' In strict mode, this will have the effect that the population process is marked as failed. If not in strict mode, the exception will be ignored.

Returns:
boolean whether the population mode is strict

setStrictPopulationMode

public void setStrictPopulationMode(boolean b)
When an unexpected error occurs, should that be interpreted as a failure, or should it just be ignored. E.g. If you have request parameter not-a-valid-property, Ognl will throw exception 'ognl.InappropriateExpressionException' In strict mode, this will have the effect that the population process is marked as failed. If not in strict mode, the exception will be ignored.

Parameters:
b - whether the population mode is strict

isTrimStringInputValues

public boolean isTrimStringInputValues()
Get whether string input values should be trimmed before conversion. True by default.

Returns:
boolean hhether string input values should be trimmed before conversion.

setTrimStringInputValues

public void setTrimStringInputValues(boolean b)
Set whether string input values should be trimmed before conversion.

Parameters:
b - Whether string input values should be trimmed before conversion.

isPopulateAndValidate

public boolean isPopulateAndValidate()
Get flag whether Baritus should try to populate the form bean. Setting this flag to false, and thus letting Baritus skip population and validation can be usefull when you link commands within the same request and want to reuse the allready populated form bean without doing population and validation as well.
BEWARE that this is also skips population of request attributes etc. that were set by the controllers earlier in the command stack.
ALSO note that if this flag is false, Baritus will consider population to be succesfull, even though the population of the prior control might not have been.

Returns:
boolean whether Baritus should try to populate the form bean.

setPopulateAndValidate

public void setPopulateAndValidate(boolean populateAndValidate)
Set flag whether Baritus should try to populate the form bean. Setting this flag to false, and thus letting Baritus skip population and validation can be usefull when you link commands within the same request and want to reuse the allready populated form bean without doing population and validation as well.
BEWARE that this is also skips population of request attributes etc. that were set by the controllers earlier in the command stack.
ALSO note that if this flag is false, Baritus will consider population to be succesfull, even though the population of the prior control might not have been.

Parameters:
populateAndValidate - whether Baritus should try to populate the form bean.

clone

public java.lang.Object clone()
Clone this object.

Returns:
Object deep copy
See Also:
Object.clone()

toString

public java.lang.String toString()
String rep.

See Also:
Object.toString()


Copyright © 2003-2004 Open Edge. All Rights Reserved.