public interface CurrencyFormattingSession extends OsidSession
This session defines methods to format and parse currency amounts.
Modifier and Type | Method and Description |
---|---|
boolean |
canFormatCurrencies()
Tests if this user can format and parse currencies.
|
java.lang.String[] |
currenciesToStrings(Currency[] amounts)
Gets a string representation of a list of currency amounts including
the currency symbols indicated by the currency type.
|
java.lang.String |
currencyToString(Currency amount)
Gets a string representation of a currency including the currency
symbol indicated by the currency type.
|
Type |
getCurrencyType()
Gets the currency type for amounts used in this session.
|
Type |
getNumericFormatType()
Gets the numeric format type for the amounts used in this session.
|
Currency |
stringToCurrency(java.lang.String s)
Parses a currency amount.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Type getCurrencyType()
mandatory
- This method must be implemented. Type getNumericFormatType()
mandatory
- This method must be implemented. boolean canFormatCurrencies()
PERMISSION_DENIED.
This is intended as a hint to an
application that may opt not to offer lookup operations. false
if translation methods are not
authorized, true
otherwisemandatory
- This method must be implemented. java.lang.String currencyToString(Currency amount) throws OperationFailedException, PermissionDeniedException
amount
- a currency valueInvalidArgumentException
-
amount.getCurrencyType() != getCurrencyType()
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. java.lang.String[] currenciesToStrings(Currency[] amounts) throws OperationFailedException, PermissionDeniedException
amounts
- an array of amountsInvalidArgumentException
-
amount.getCurrencyType() != getCurrencyType()
NullArgumentException
- amounts
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. Currency stringToCurrency(java.lang.String s) throws OperationFailedException, PermissionDeniedException
s
- a currency stringInvalidArgumentException
- s is not of
getCurrencyType()
or s is not of
getNumericFormatType()
NullArgumentException
- s
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.