View Javadoc
1 /* 2 * Copyright (C) The Spice Group. All rights reserved. 3 * 4 * This software is published under the terms of the Spice 5 * Software License version 1.1, a copy of which has been included 6 * with this distribution in the LICENSE.txt file. 7 */ 8 package org.codehaus.spice.converter.lib; 9 10 import org.codehaus.spice.converter.ConverterFactory; 11 import org.codehaus.spice.converter.Converter; 12 13 /*** 14 * A converter factory that just returns value supplied in ctor. 15 * 16 * @author Peter Donald 17 * @version $Revision: 1.1 $ $Date: 2003/12/02 08:37:56 $ 18 */ 19 public class SingletonConverterFactory 20 implements ConverterFactory 21 { 22 /*** 23 * The converter managed by factory. 24 */ 25 private Converter m_converter; 26 27 /*** 28 * Create factory with specified converter as singleton returned. 29 * 30 * @param converter the converter 31 */ 32 public SingletonConverterFactory( final Converter converter ) 33 { 34 if( null == converter ) 35 { 36 throw new NullPointerException( "converter" ); 37 } 38 m_converter = converter; 39 } 40 41 /*** 42 * Return the singleton converter. 43 * 44 * @return the singleton converter. 45 */ 46 public Converter createConverter() 47 { 48 return m_converter; 49 } 50 }

This page was automatically generated by Maven