Package com.cantaa.util.wicket.converter

Source Code of com.cantaa.util.wicket.converter.MoneyConverter

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<Money> {

    @Override
    protected Class<Money> 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);
    }
}
TOP

Related Classes of com.cantaa.util.wicket.converter.MoneyConverter

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.