boolean isList = false;
if ("java.util.List".equals(typeName)) {
isList = true;
logger.debug(" LIST {}", typeName);
}
final ElementRefList reflist = c.getElementRefList(revision);
if (reflist != null) {
for (Element e : reflist.getElementList()) {
typeName = e.getElementType().getName();
final Constructor constr = Class.forName(typeName)
.getConstructor();
final Object child = constr.newInstance();
logger.debug(" SET {} -- {}", typeName);
l.add(loadElement(e, timestamp, child,
Class.forName(e.getElementType().getName())));
}
}
if (isList) {
method.invoke(bean, new Object[] { l });
} else if (!l.isEmpty()) {
method.invoke(bean, new Object[] { l.get(0) });
}
} else {
name = getMethodName("get", c.getRefName());
method = findMethod(clazz, name);
if (method == null) {
name = getMethodName("is", c.getRefName());
method = findMethod(clazz, name);
}
if (method != null) {
final Class retType = method.getReturnType();
String typeName = retType.getCanonicalName();
List l = (List) method.invoke(bean); // NOPMD by wim on 9/20/10
// 3:04 PM
final ElementRefList reflist = c.getElementRefList(revision);
if (reflist != null) {
for (Element e : reflist.getElementList()) {
typeName = e.getElementType().getName();
final Constructor constr = Class.forName(typeName)
.getConstructor();
final Object child = constr.newInstance();
logger.debug(" GET {} -- {}", name, typeName);