/* * (non-Javadoc) * * @see mypetstore.util.DozerConvertUtil#domainObjectsToViewObjects(java.util.List, * java.lang.Class) */ public List domainObjectsToViewObjects(List domainObjects, Class viewObject) { List viewObjects = new ArrayList(0); try { if (CollectionUtils.isCollection(domainObjects.getClass())) { int domainObjects_length = CollectionUtils.getLengthOfCollection(domainObjects); viewObjects = new ArrayList(domainObjects_length); for (int i = 0; i < domainObjects_length; i++) { IViewObject vo = (IViewObject) viewObject.newInstance(); dozerBeanMapper.map(CollectionUtils.getValueFromCollection(domainObjects, i), vo); viewObjects.add(vo); } } } catch (Exception e) { viewObjects = new ArrayList(0); } return viewObjects; }
/* * (non-Javadoc) * * @see mypetstore.util.DozerConvertUtil#viewObjectsToDomainObjects(java.util.List, * java.lang.Class) */ public List viewObjectsToDomainObjects(List viewObjects, Class domainObject) { List domainObjects = new ArrayList(0); try { if (CollectionUtils.isCollection(viewObjects.getClass())) { int viewObjects_length = CollectionUtils.getLengthOfCollection(viewObjects); domainObjects = new ArrayList(viewObjects_length); for (int i = 0; i < viewObjects_length; i++) { IDomainObject DO = (IDomainObject) domainObject.newInstance(); dozerBeanMapper.map(CollectionUtils.getValueFromCollection(viewObjects, i), DO); domainObjects.add(DO); } } } catch (Exception e) { domainObjects = new ArrayList(0); } return domainObjects; }