|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.decisiondeck.jmcda.persist.xmcda2.utils.XMCDAHelper
org.decisiondeck.jmcda.persist.xmcda2.XMCDAVarious
public class XMCDAVarious
Reads from and writes to various XMCDA fragments. Contains methods not found in other classes to read and write numbers, strings, and other elementary structures.
| Constructor Summary | |
|---|---|
XMCDAVarious()
Creates a new object which will use the default error management strategy XMCDAErrorsManager.ErrorManagement.THROW. |
|
XMCDAVarious(XMCDAErrorsManager errorsManager)
Creates a new object delegating error management to the given error manager in case of unexpected data read. |
|
| Method Summary | |
|---|---|
Double |
readDouble(Collection<XValue> xValues,
String contextMessageIfEmpty)
Retrieves the number embedded in the given fragment. |
Double |
readDouble(XMethodParameters xMethodParameters,
String contextMessageIfEmpty)
Retrieves the number embedded in the given fragment. |
Double |
readDouble(XNumericValue xNumber)
Retrieves the number embedded in the given fragment. |
Double |
readDouble(XParameter xParameter)
Retrieves the number embedded in the given fragment. |
Double |
readDouble(XValue xValue)
Retrieves the number embedded in the given fragment. |
String |
readLabel(XMethodParameters xMethodParameters,
String contextMessageIfEmpty)
Retrieves the label embedded in the given fragment. |
String |
readLabel(XParameter xParameter)
Retrieves the label embedded in the given fragment. |
String |
readLabel(XValue xValue)
Retrieves the label embedded in the given fragment. |
List<String> |
readMessages(XMethodMessages xMethodMessages)
|
XMethodParameters |
writeAsMethodParameters(double value)
Retrieves the given value as an XMCDA fragment. |
XMethodParameters |
writeAsMethodParameters(String value)
Retrieves the given value as an XMCDA fragment. |
XParameter |
writeAsParameter(double value)
Retrieves the given value as an XMCDA fragment. |
XParameter |
writeAsParameter(String value)
Retrieves the given value as an XMCDA fragment. |
XProjectReference |
writeComment(String comment)
Retrieves the given value as an XMCDA project reference fragment. |
XMessage |
writeErrorMessage(String errorMessage)
Retrieves the given error message as an XMessage fragment. |
XMethodMessages |
writeErrorMessages(Collection<String> errorMessages)
Retrieves the given error messages as an XMethodMessages fragment. |
XMessage |
writeLogMessage(String logMessage)
Retrieves the given log message as an XMessage fragment. |
XMessage |
writeMessage(String message)
Retrieves the given message as an XMessage fragment. |
XMethodMessages |
writeMessages(Collection<String> messages)
Retrieves the given messages as an XMethodMessages fragment. |
| Methods inherited from class org.decisiondeck.jmcda.persist.xmcda2.utils.XMCDAHelper |
|---|
error, getStrategy, setStrategy |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XMCDAVarious()
XMCDAErrorsManager.ErrorManagement.THROW.
public XMCDAVarious(XMCDAErrorsManager errorsManager)
errorsManager - not null.| Method Detail |
|---|
public XProjectReference writeComment(String comment)
comment - not null.
null.public XMessage writeMessage(String message)
XMessage fragment.
message - not null.
null.public XMessage writeErrorMessage(String errorMessage)
XMessage fragment.
errorMessage - not null.
null.public XMessage writeLogMessage(String logMessage)
XMessage fragment.
logMessage - not null.
null.
public Double readDouble(Collection<XValue> xValues,
String contextMessageIfEmpty)
throws InvalidInputException
Retrieves the number embedded in the given fragment.
This method expects there is exactly one element in the given collection and it contains a number. In case of
unexpected contents, this method returns null or throws an exception depending on the strategy this
object follows.
xValues - not null.contextMessageIfEmpty - if not null, is used to give a more useful error message about the context when the given
collection is empty.
null iff unexpected content has been read and this object follows a
permissive strategy.
InvalidInputException - iff unexpected content has been read and this object follows the XMCDAErrorsManager.ErrorManagement.THROW
strategy.
public Double readDouble(XMethodParameters xMethodParameters,
String contextMessageIfEmpty)
throws InvalidInputException
Retrieves the number embedded in the given fragment.
This method expects the fragments contains a unique number. In case of unexpected contents, this method returns
null or throws an exception depending on the strategy this object follows.
xMethodParameters - not null.contextMessageIfEmpty - if not null, is used to give a more useful error message about the context when the given
fragment contains an empty collection.
null iff unexpected content has been read and this object follows a
permissive strategy.
InvalidInputException - iff unexpected content has been read and this object follows the XMCDAErrorsManager.ErrorManagement.THROW
strategy.
public Double readDouble(XNumericValue xNumber)
throws InvalidInputException
Retrieves the number embedded in the given fragment.
This method expects the fragments contains a number. In case of unexpected contents, this method returns
null or throws an exception depending on the strategy this object follows.
xNumber - not null.
null iff unexpected content has been read and this object follows a
permissive strategy.
InvalidInputException - iff unexpected content has been read and this object follows the XMCDAErrorsManager.ErrorManagement.THROW
strategy.
public Double readDouble(XParameter xParameter)
throws InvalidInputException
Retrieves the number embedded in the given fragment.
This method expects the fragments contains a number. In case of unexpected contents, this method returns
null or throws an exception depending on the strategy this object follows.
xParameter - not null.
null iff unexpected content has been read and this object follows a
permissive strategy.
InvalidInputException - iff unexpected content has been read and this object follows the XMCDAErrorsManager.ErrorManagement.THROW
strategy.
public Double readDouble(XValue xValue)
throws InvalidInputException
Retrieves the number embedded in the given fragment.
This method expects the fragments contains a number. In case of unexpected contents, this method returns
null or throws an exception depending on the strategy this object follows.
xValue - not null.
null iff unexpected content has been read and this object follows a
permissive strategy.
InvalidInputException - iff unexpected content has been read and this object follows the XMCDAErrorsManager.ErrorManagement.THROW
strategy.
public String readLabel(XMethodParameters xMethodParameters,
String contextMessageIfEmpty)
throws InvalidInputException
Retrieves the label embedded in the given fragment.
This method expects the given fragment contains a unique non null label. In case of unexpected
contents, this method returns null or throws an exception depending on the strategy this object
follows.
xMethodParameters - not null.contextMessageIfEmpty - if not null, is used to give a more useful error message about the context when the given
fragment contains an empty collection.
null iff unexpected content has been read and this object follows a permissive
strategy.
InvalidInputException - iff unexpected content has been read and this object follows the XMCDAErrorsManager.ErrorManagement.THROW
strategy.
public String readLabel(XParameter xParameter)
throws InvalidInputException
Retrieves the label embedded in the given fragment.
This method expects the given fragment contains a non null label. In case of unexpected contents,
this method returns null or throws an exception depending on the strategy this object follows.
xParameter - not null.
null iff unexpected content has been read and this object follows a permissive
strategy.
InvalidInputException - iff unexpected content has been read and this object follows the XMCDAErrorsManager.ErrorManagement.THROW
strategy.
public String readLabel(XValue xValue)
throws InvalidInputException
Retrieves the label embedded in the given fragment.
This method expects the given fragment contains a non null label. In case of unexpected contents,
this method returns null or throws an exception depending on the strategy this object follows.
xValue - not null.
null iff unexpected content has been read and this object follows a permissive
strategy.
InvalidInputException - iff unexpected content has been read and this object follows the XMCDAErrorsManager.ErrorManagement.THROW
strategy.public XMethodParameters writeAsMethodParameters(double value)
value - the value to write.
null.public XMethodParameters writeAsMethodParameters(String value)
value - the value to write.
null.public XParameter writeAsParameter(double value)
value - the value to write.
null.public XParameter writeAsParameter(String value)
value - the value to write.
null.public XMethodMessages writeMessages(Collection<String> messages)
XMethodMessages fragment.
messages - not null.
null.public XMethodMessages writeErrorMessages(Collection<String> errorMessages)
XMethodMessages fragment.
errorMessages - not null.
null.public List<String> readMessages(XMethodMessages xMethodMessages)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||