Java Code Examples for javax.money.CurrencyUnit#getCurrencyCode()

The following examples show how to use javax.money.CurrencyUnit#getCurrencyCode() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CurrencyUnitFormatter.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Override
public String print(CurrencyUnit object, Locale locale) {
	return object.getCurrencyCode();
}
 
Example 2
Source File: CurrencyUnitFormatter.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
public String print(CurrencyUnit object, Locale locale) {
	return object.getCurrencyCode();
}
 
Example 3
Source File: CurrencyUnitFormatter.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public String print(CurrencyUnit object, Locale locale) {
	return object.getCurrencyCode();
}
 
Example 4
Source File: CurrencyUnitFormatter.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Override
public String print(CurrencyUnit object, Locale locale) {
	return object.getCurrencyCode();
}
 
Example 5
Source File: StringColumnCurrencyUnitMapper.java    From jadira with Apache License 2.0 4 votes vote down vote up
@Override
public String toNonNullValue(CurrencyUnit value) {
    return value.getCurrencyCode();
}
 
Example 6
Source File: CurrencyToken.java    From jsr354-ri with Apache License 2.0 3 votes vote down vote up
/**
 * This method tries to evaluate the localized display name for a
 * {@link CurrencyUnit}. It uses {@link Currency#getDisplayName(Locale)} if
 * the given currency code maps to a JDK {@link Currency} instance.
 * <p>
 * If not found {@code currency.getCurrencyCode()} is returned.
 *
 * @param currency The currency, not {@code null}
 * @return the formatted currency name.
 */
private String getCurrencyName(CurrencyUnit currency) {
    Currency jdkCurrency = getCurrency(currency.getCurrencyCode());
    if (Objects.nonNull(jdkCurrency)) {
        return jdkCurrency.getDisplayName(locale);
    }
    return currency.getCurrencyCode();
}
 
Example 7
Source File: CurrencyToken.java    From jsr354-ri with Apache License 2.0 3 votes vote down vote up
/**
 * This method tries to evaluate the localized symbol name for a
 * {@link CurrencyUnit}. It uses {@link Currency#getSymbol(Locale)} if the
 * given currency code maps to a JDK {@link Currency} instance.
 * <p>
 * If not found {@code currency.getCurrencyCode()} is returned.
 *
 * @param currency The currency, not {@code null}
 * @return the formatted currency symbol.
 */
private String getCurrencySymbol(CurrencyUnit currency) {
    Currency jdkCurrency = getCurrency(currency.getCurrencyCode());
    if (Objects.nonNull(jdkCurrency)) {
        return jdkCurrency.getSymbol(locale);
    }
    return currency.getCurrencyCode();
}