pt.digitalis.dif.dem.objects.parameters.errors
Class ParameterErrors

java.lang.Object
  extended by pt.digitalis.dif.dem.objects.parameters.errors.ParameterErrors

public class ParameterErrors
extends Object

A report object of any parameter errors that have occurred in the initialization of a stage. These will be injected into a stage attribute for evaluation by the stage as the developer sees fit.

Author:
Pedro Viegas pviegas@digitalis.pt, Rodrigo Gon�alves rgoncalves@digitalis.pt

Constructor Summary
ParameterErrors(IStageInstance stageInstance)
          Constructor.
 
Method Summary
 void addParameterError(String parameterId, ParameterError error)
          Adds a new parameter to.
 void discardAllErrors()
          Discards all errors.
 void discardErrors(String parameterId)
          Discards all errors for a specific parameter.
 void discardErrorsOfType(ParameterErrorType type)
          Discards all errors for a specific parameter.
 Map<String,ParameterErrorList> getAllParameterErrors()
          Get all errors for all parameters.
 ParameterErrorList getErrorsForParameter(String parameterID)
          Retrieves the errors for a given parameter ID.
 boolean hasErrors()
          Checks if errors exist.
 boolean hasErrorsForForm(String formName)
          Checks if errors exist.
 boolean hasErrorsIgnoreParcialSubmitErrors()
          Checks if errors exist.
 Object refreshParameter(IParameter<?> param, IStageInstance stageInstance)
          Refreshes the passed parameter and adds errors to the list if they are detected.
 void refreshParameters(IStageInstance stageInstance)
          Refreshes all remaining parameters and adds errors to the list if they are detected.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ParameterErrors

public ParameterErrors(IStageInstance stageInstance)
Constructor.

Parameters:
stageInstance - the current stage
Method Detail

addParameterError

public void addParameterError(String parameterId,
                              ParameterError error)
                       throws ParameterException
Adds a new parameter to.

Parameters:
parameterId - the parameter to add the error to
error - the error
Throws:
ParameterException - if the parameter does not exist

discardAllErrors

public void discardAllErrors()
Discards all errors.


discardErrors

public void discardErrors(String parameterId)
Discards all errors for a specific parameter.

Parameters:
parameterId - the parameter to discard errors

discardErrorsOfType

public void discardErrorsOfType(ParameterErrorType type)
Discards all errors for a specific parameter.

Parameters:
type - the parameter type of errors to discard

getAllParameterErrors

public Map<String,ParameterErrorList> getAllParameterErrors()
Get all errors for all parameters.

Returns:
the errors

getErrorsForParameter

public ParameterErrorList getErrorsForParameter(String parameterID)
Retrieves the errors for a given parameter ID.

Parameters:
parameterID - the desired parameter id
Returns:
the parameter list

hasErrors

public boolean hasErrors()
Checks if errors exist.

Returns:
T if there are errors

hasErrorsForForm

public boolean hasErrorsForForm(String formName)
Checks if errors exist.

Parameters:
formName - the form name
Returns:
T if there are errors

hasErrorsIgnoreParcialSubmitErrors

public boolean hasErrorsIgnoreParcialSubmitErrors()
Checks if errors exist. Will ignore all errors related with partial submit of a form. Required fields not submited. But validating errors in the fields that were filled.

Returns:
T if there are errors

refreshParameter

public Object refreshParameter(IParameter<?> param,
                               IStageInstance stageInstance)
Refreshes the passed parameter and adds errors to the list if they are detected.

Parameters:
param - the parameter to refresh
stageInstance - the stage of the refresh request
Returns:
the refreshed value

refreshParameters

public void refreshParameters(IStageInstance stageInstance)
                       throws ParameterException
Refreshes all remaining parameters and adds errors to the list if they are detected.

Parameters:
stageInstance - the stage of the refresh request
Throws:
ParameterException

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2014 Digitalis Informática Lda. All Rights Reserved.