com.jpattern.ioc.xml.ParameterMap Maven / Gradle / Ivy
package com.jpattern.ioc.xml;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import com.jpattern.ioc.IContextCreator;
import com.jpattern.ioc.exception.ConfigException;
/**
*
* @author Francesco Cina'
*
* 19/dic/2009
*/
public class ParameterMap implements IParameter {
private List entries = new ArrayList();
public ParameterMap() {
}
public void add(Entry aEntry) {
entries.add(aEntry);
}
public List getEntries() {
return entries;
}
public Object typedValue(IContextCreator aContextCreator) throws ConfigException, ClassNotFoundException {
Map returnedMap = new HashMap();
ListIterator entriesIterator = getEntries().listIterator();
IEntry iEntry;
while (entriesIterator.hasNext()) {
iEntry = (IEntry)entriesIterator.next();
returnedMap.put(iEntry.getKey().key(), iEntry.typedValue(aContextCreator));
}
return returnedMap;
}
@SuppressWarnings("rawtypes")
public Class typedClass(IContextCreator aContextCreator) throws ConfigException, ClassNotFoundException {
return HashMap.class;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy