org.decisiondeck.jmcda.persist.xmcda2.utils
Class XMCDAErrorsManagerForwarder

java.lang.Object
  extended by org.decisiondeck.jmcda.persist.xmcda2.utils.XMCDAErrorsManagerForwarder
Direct Known Subclasses:
XMCDAReadUtils

public class XMCDAErrorsManagerForwarder
extends Object


Constructor Summary
XMCDAErrorsManagerForwarder()
          Forwards to a new XMCDAErrorsManager which uses the default strategy XMCDAErrorsManager.ErrorManagement.THROW.
XMCDAErrorsManagerForwarder(XMCDAErrorsManager errorsManager)
          Forwards to the given object.
 
Method Summary
 void error(String error)
          Throws an exception with the given error message if this object follows a XMCDAErrorsManager.ErrorManagement.THROW strategy (the default); otherwise, logs the error or collects the error.
 List<String> getErrors()
          Retrieves a read-only view to the list of errors collected in this object.
 XMCDAErrorsManager.ErrorManagement getStrategy()
          Retrieves the strategy this object currently follows.
 void setStrategy(XMCDAErrorsManager.ErrorManagement strategy)
          Sets the strategy this object will follow.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMCDAErrorsManagerForwarder

public XMCDAErrorsManagerForwarder()
Forwards to a new XMCDAErrorsManager which uses the default strategy XMCDAErrorsManager.ErrorManagement.THROW.


XMCDAErrorsManagerForwarder

public XMCDAErrorsManagerForwarder(XMCDAErrorsManager errorsManager)
Forwards to the given object.

Parameters:
errorsManager - not null.
Method Detail

error

public void error(String error)
           throws InvalidInputException
Throws an exception with the given error message if this object follows a XMCDAErrorsManager.ErrorManagement.THROW strategy (the default); otherwise, logs the error or collects the error.

Parameters:
error - null or empty for no error message.
Throws:
InvalidInputException - if the strategy is XMCDAErrorsManager.ErrorManagement.THROW.
See Also:
#setStrategy(ErrorManagement)

getStrategy

public XMCDAErrorsManager.ErrorManagement getStrategy()
Retrieves the strategy this object currently follows.

Returns:
not null.

setStrategy

public void setStrategy(XMCDAErrorsManager.ErrorManagement strategy)
Sets the strategy this object will follow.

Parameters:
strategy - not null.

getErrors

public List<String> getErrors()
Retrieves a read-only view to the list of errors collected in this object. The list is populated only if this object uses the XMCDAErrorsManager.ErrorManagement.COLLECT strategy, and it is emptied if the strategy is changed.

Returns:
not null.


Copyright © 2011. All Rights Reserved.