public SectionContentsBean(SectionDataIfc section) { try { this.itemContents = new ArrayList(); setSectionId(section.getSectionId().toString()); setTitle(section.getTitle()); setDescription(section.getDescription()); Integer sequence = section.getSequence(); if (sequence != null) { setNumber(sequence.toString()); } else { setNumber("1"); } setNumber(section.getSequence().toString()); // do teh rest later Set itemSet = section.getItemSet(); if (itemSet != null) { setQuestions(itemSet.size()); Iterator i = itemSet.iterator(); while (i.hasNext()) { ItemDataIfc item = (ItemDataIfc) i.next(); ItemContentsBean itemBean = new ItemContentsBean(item); this.itemContents.add(itemBean); } } // set questionNumbers now setQuestionNumbers(); setMetaData(section); this.attachmentList = section.getSectionAttachmentList(); if (this.attachmentList != null && this.attachmentList.size() > 0) this.hasAttachment = true; } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(e); } }