All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jpattern.ioc.xml.ParameterList Maven / Gradle / Ivy

There is a newer version: 2.7.1
Show newest version
package com.jpattern.ioc.xml;

import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;

import com.jpattern.ioc.IContextCreator;
import com.jpattern.ioc.exception.ConfigException;

/**
 * 
 * @author Francesco Cina'
 *
 * 19/dic/2009
 */
public class ParameterList  implements IParameter  {
        
        private List entries = new ArrayList();
        
        public ParameterList() {
        }

        
        public void add(Entry aEntry) {
            entries.add(aEntry);
        }

        public List getEntries() {
            return entries;
        }

        public Object typedValue(IContextCreator aContextCreator) throws ConfigException, ClassNotFoundException {
            List returnedList = new ArrayList();
            ListIterator entriesIterator = getEntries().listIterator();
            IEntry iEntry;
            while (entriesIterator.hasNext()) {
                iEntry = entriesIterator.next();
                returnedList.add(iEntry.typedValue(aContextCreator));
            }
            return returnedList;
        }


		@SuppressWarnings("rawtypes")
		public Class typedClass(IContextCreator aContextCreator) throws ConfigException, ClassNotFoundException {
			return List.class;
		}

}