001/* 002 * Copyright (c) 2012, 2013, Werner Keil, Credit Suisse (Anatole Tresch). Licensed under the Apache 003 * License, Version 2.0 (the "License"); you may not use this file except in compliance with the 004 * License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 005 * Unless required by applicable law or agreed to in writing, software distributed under the License 006 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 007 * or implied. See the License for the specific language governing permissions and limitations under 008 * the License. Contributors: Anatole Tresch - initial version. 009 */ 010package org.javamoney.tck.tests.internal; 011 012import javax.money.MonetaryAmountFactory; 013import javax.money.MonetaryContext; 014import javax.money.spi.MonetaryAmountFactoryProviderSpi; 015 016/** 017 * Test provider for TestAmounts. 018 */ 019public final class TestMonetaryAmountFactoryProvider implements MonetaryAmountFactoryProviderSpi { 020 021 @Override 022 public QueryInclusionPolicy getQueryInclusionPolicy() { 023 return QueryInclusionPolicy.DIRECT_REFERENCE_ONLY; 024 } 025 026 @Override 027 public Class getAmountType() { 028 return TestAmount.class; 029 } 030 031 @Override 032 public MonetaryAmountFactory createMonetaryAmountFactory() { 033 return new TestMonetaryAmountBuilder(); 034 } 035 036 @Override 037 public MonetaryContext getDefaultMonetaryContext() { 038 return TestAmount.MONETARY_CONTEXT; 039 } 040 041 @Override 042 public MonetaryContext getMaximalMonetaryContext() { 043 return TestAmount.MONETARY_CONTEXT; 044 } 045}