((objectsCollection.size() == 1) && (objectsCollection.iterator().next() == null))) {
return null;
} else {
List mapObjectsList = (List) objectsCollection;
MapType mapType = null;
Map mapObject = null;
if (javaClass.isInterface()) {
mapObject = new HashMap();
} else {
try {
mapObject = (Map) javaClass.newInstance();
} catch (InstantiationException e) {
throw new XmlParsingException("Can not instantiate the java class " + javaClass.getName(), e);
} catch (IllegalAccessException e) {
throw new XmlParsingException("Can not instantiate the java class " + javaClass.getName(), e);
}
}
for (Iterator iter = mapObjectsList.iterator(); iter.hasNext();) {
mapType = (MapType) iter.next();
mapObject.put(mapType.getKey(), mapType.getValue());
}
return mapObject;
}