All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.cantaa.util.wicket.converter.MoneyConverter Maven / Gradle / Ivy

There is a newer version: 2.0
Show newest version
package com.cantaa.util.wicket.converter;

import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.Locale;

import com.cantaa.util.type.Money;

/**
 * Converter for the Price-Type
 * @author Hans Lesmeister
 */
public class MoneyConverter extends AbstractAmountConverter {

    @Override
    protected Class getTargetType() {
        return Money.class;
    }

    @Override
    protected DecimalFormat getDecimalFormatInstance(Locale locale) {
        return (DecimalFormat) NumberFormat.getCurrencyInstance(locale);
    }

    @Override
    protected Money createAmount(BigDecimal value) {
        return new Money(value);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy