001/*
002 *                    BioJava development code
003 *
004 * This code may be freely distributed and modified under the
005 * terms of the GNU Lesser General Public Licence.  This should
006 * be distributed with the code.  If you do not have a copy,
007 * see:
008 *
009 *      http://www.gnu.org/copyleft/lesser.html
010 *
011 * Copyright for this code is held jointly by the individual
012 * authors.  These should be listed in @author doc comments.
013 *
014 * For more information on the BioJava project and its aims,
015 * or to join the biojava-l mailing list, visit the home page
016 * at:
017 *
018 *      http://www.biojava.org/
019 *
020 */
021
022package org.biojavax;
023
024import java.util.List;
025
026/**
027 * This interface allows a class to generate Rich objects based on a class
028 * name and some parameters. The idea is to allow maintenance of a singleton
029 * map.
030 * @author Richard Holland
031 * @since 1.5
032 */
033public interface RichObjectBuilder {
034    
035    /**
036     * This method takes a class name and some parameters, and uses that
037     * information to construct and return an equivalent object, usually by
038     * calling the constructor on the class with the supplied parameters.
039     * Note that it only works with classes whose constructors take only
040     * Objects, and not primitives. It should return singletons.
041     * @param clazz the class to instantiate and build
042     * @param paramsList the parameters to pass to the constructor
043     * @return an instance of the requested class/params combination. May or
044     * may not be a singleton, but usually will be given as that is the 
045     * purpose of this class.
046     */
047    public Object buildObject(Class clazz, List paramsList);
048    
049}