001/* 002 * CREDIT SUISSE IS WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU 003 * ACCEPT ALL OF THE TERMS CONTAINED IN THIS AGREEMENT. PLEASE READ THE TERMS AND CONDITIONS OF THIS 004 * AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF 005 * THE AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY IT, SELECT THE "DECLINE" BUTTON AT THE 006 * BOTTOM OF THIS PAGE. Specification: JSR-354 Money and Currency API ("Specification") Copyright 007 * (c) 2012-2013, Credit Suisse All rights reserved. 008 */ 009package org.javamoney.moneta.format.internal; 010 011import java.util.Objects; 012 013import javax.money.format.AmountStyle; 014import javax.money.format.MonetaryAmountFormat; 015import javax.money.spi.MonetaryAmountFormatProviderSpi; 016 017/** 018 * Default format provider, which mainly maps the existing JDK functionality into the JSR 354 logic. 019 * 020 * @author Anatole Tresch 021 */ 022public class DefaultAmountFormatProviderSpi implements 023 MonetaryAmountFormatProviderSpi { 024 025 /* 026 * (non-Javadoc) 027 * @see 028 * javax.money.spi.MonetaryAmountFormatProviderSpi#getFormat(javax.money.format.AmountStyle) 029 */ 030 @Override 031 public MonetaryAmountFormat getAmountFormat(AmountStyle style) { 032 Objects.requireNonNull(style, "AmountStyle required"); 033 return new DefaultMonetaryAmountFormat(style); 034 } 035 036}