}
// add all headers
while (headers.hasMoreElements())
{
Header header = headers.nextElement();
String headerName = header.getName();
Object values = ret.get(headerName);
if (values == null)
{
ret.put(headerName, header.getValue());
}
else if (values instanceof String)
{
ArrayList<String> newValues = new ArrayList<String>();
newValues.add((String) values);
newValues.add(header.getValue());
ret.put(headerName, newValues);
}
else if (values instanceof List)
{
@SuppressWarnings("unchecked") // we only add Strings to the Lists
List<String> list = (List<String>) values;
list.add(header.getValue());
}
}
// add all simple get/is results (with obj. prefix)
Iterator<Entry<String, Method>> iterEntries = mimeMessageGetters.entrySet().iterator();