
com.cantaa.util.wicket.converter.MoneyConverter Maven / Gradle / Ivy
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