|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.decisiondeck.jmcda.persist.xmcda2.utils.XMCDAErrorsManager
public class XMCDAErrorsManager
When reading from XMCDA fragments, data read might be different than what is expected. This class permits to deal with such unexpected data and may be configured to adopt various strategies to manage such situations. Classes reading from XMCDA fragments typically delegate unexpected data situations management to objects of this class.
When the context makes it unambiguous, this documentation uses the term error to refer to a situation where an unexpected data has been read. An example of an error is that a number is expected but a string was read, or that a single xml entity was expected but a collection of several such entities was found instead.
| Nested Class Summary | |
|---|---|
static class |
XMCDAErrorsManager.ErrorManagement
Indicates what to do when unexpected data is read. |
| Constructor Summary | |
|---|---|
XMCDAErrorsManager()
Defaults to XMCDAErrorsManager.ErrorManagement.THROW strategy. |
|
XMCDAErrorsManager(XMCDAErrorsManager.ErrorManagement strategy)
Creates a new object configured to follow the given error management strategy. |
|
| 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 |
|---|
public XMCDAErrorsManager()
XMCDAErrorsManager.ErrorManagement.THROW strategy.
public XMCDAErrorsManager(XMCDAErrorsManager.ErrorManagement strategy)
strategy - not null.| Method Detail |
|---|
public void error(String error)
throws InvalidInputException
XMCDAErrorsManager.ErrorManagement.THROW strategy
(the default); otherwise, logs the error or collects the error.
error - null or empty for no error message.
InvalidInputException - if the strategy is XMCDAErrorsManager.ErrorManagement.THROW.setStrategy(ErrorManagement)public XMCDAErrorsManager.ErrorManagement getStrategy()
null.public void setStrategy(XMCDAErrorsManager.ErrorManagement strategy)
strategy - not null.public List<String> getErrors()
XMCDAErrorsManager.ErrorManagement.COLLECT strategy, and it is emptied if the strategy is changed.
null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||