View Javadoc
1 /* 2 * ValueListHandler.java 3 * 4 * Created on March 21, 2003, 2:45 PM 5 */ 6 7 package com.mlw.vlh; 8 9 import net.sf.common.config.Configuration; 10 import net.sf.common.config.ConfigurationFactory; 11 12 import org.apache.commons.logging.Log; 13 import org.apache.commons.logging.LogFactory; 14 15 import com.mlw.vlh.impl.DefaltValueListHandler; 16 /*** 17 * 18 * @author Matthew Wilson 19 */ 20 public abstract class ValueListHandler 21 { 22 /*** Logger used for any subclass 23 */ 24 public static final Log log = LogFactory.getLog(ValueListHandler.class); 25 26 /*** Factory method instance 27 */ 28 private static ValueListHandler instance = null; 29 30 /*** Factory method. 31 * @return Returns a subclass of ValueListHandler. 32 */ 33 public static ValueListHandler getInstance() 34 { 35 if( instance == null ) 36 { 37 String clazz = DefaltValueListHandler.class.getName(); 38 39 try 40 { 41 Configuration config = ConfigurationFactory.getFactory().getConfig(ValueListHandler.class); 42 clazz = config.getString("ValueListHandler", clazz); 43 instance = (ValueListHandler)Class.forName(clazz).newInstance(); 44 } 45 catch(Exception e) 46 { 47 log.error("Error constructing class: " + clazz, e); 48 } 49 } 50 51 return instance; 52 } 53 54 /*** Gets a ValueList 55 * @param info The <CODE>ValueList</CODE> information 56 * @param name The name of the <CODE>ValueList</CODE> 57 * @return The <CODE>ValueList</CODE> 58 */ 59 public abstract ValueList getValueList(ValueListInfo info, String name); 60 }

This page was automatically generated by Maven