Package ch.semafor.gendas.model

Examples of ch.semafor.gendas.model.ElementRefList


            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);
View Full Code Here


            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()) {
                l.add(loadElement(e, revision));
              }
            }
            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()) {
                  l.add(loadElement(e, revision));
                }
              }
            }
          }
View Full Code Here

TOP

Related Classes of ch.semafor.gendas.model.ElementRefList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.