Item ontoItem = ItemHelper.convert(srcItemReader.getItemById((String) l.next())); sb.append(ontoItem.getAttribute("value").getValue() + " ");
Item ontoItem = ItemHelper.convert(srcItemReader.getItemById( (String) l.next())); sb.append(ontoItem.getAttribute("value").getValue() + " "); } tgtItem.addAttribute(new Attribute("failType", sb.toString()));
    protected void setBioEntityMap(Item srcItem, Item tgtItem)        throws ObjectStoreException {        StringBuffer sb = new StringBuffer();        ReferenceList failTypes = new ReferenceList();        failTypes = srcItem.getCollection("failTypes");        if (failTypes != null) {            for (Iterator l = srcItem.getCollection("failTypes").getRefIds().iterator();                     l.hasNext();) {                Item ontoItem = ItemHelper.convert(srcItemReader.getItemById((String) l.next()));                sb.append(ontoItem.getAttribute("value").getValue() + " ");            }            tgtItem.addAttribute(new Attribute("failType", sb.toString()));        }        Reference controlType = new Reference();        controlType = srcItem.getReference("controlType");        boolean controlFlg = false;        if (controlType != null) {            Item controlItem = ItemHelper.convert(srcItemReader.getItemById(                                     (String) srcItem.getReference("controlType").getRefId()));            if (controlItem.getAttribute("value").getValue().equals("control_buffer")) {                controlFlg = true;            }        }        ReferenceList featureReporterMaps = srcItem.getCollection("featureReporterMaps");        ReferenceList immobilizedChar = srcItem.getCollection("immobilizedCharacteristics");        sb = new StringBuffer();        String identifier = null;        if (immobilizedChar == null) {            if (failTypes != null) {                //throw new IllegalArgumentException(                LOG.info("Reporter ("                        + srcItem.getIdentifier()                        + ") does not have immobilizedCharacteristics because it fails");            } else if (controlFlg) {                LOG.info("Reporter ("                        + srcItem.getIdentifier()                        + ") does not have immobilizedCharacteristics because"                        + " it is a control_buffer");            } else {                throw new IllegalArgumentException("Reporter ("                        + srcItem.getIdentifier()                        + ") does not have immobilizedCharacteristics");            }        } else if (!isSingleElementCollection(immobilizedChar)) {            throw new IllegalArgumentException("Reporter ("                        + srcItem.getIdentifier()                        + ") have more than one immobilizedCharacteristics");        } else {            //create bioEntity2IdentifierMap            //identifier = reporter: name for CDNAClone, Vector            //identifier = reporter: controlType;name;descriptions for genomic_dna            identifier = (String) immobilizedChar.getRefIds().get(0);            if (tgtItem.getClassName().equals(tgtNs + "NuclearDNA")) {                sb = new StringBuffer();                if (srcItem.hasReference("controlType")) {                    Item controlItem = ItemHelper.convert(srcItemReader.getItemById(                                      (String) srcItem.getReference("controlType").getRefId()));                    if (controlItem.hasAttribute("value")) {                        sb.append(controlItem.getAttribute("value").getValue() + ";");                    }                }                if (srcItem.hasAttribute("name")) {                    sb.append(srcItem.getAttribute("name").getValue() + ";");                }                if (srcItem.hasCollection("descriptions")) {                    for (Iterator k = srcItem.getCollection("descriptions").getRefIds().iterator();                             k.hasNext();) {                        Item description = ItemHelper.convert(srcItemReader.getItemById(                                                (String) k.next()));                        if (description.hasAttribute("text")) {                            sb.append(description.getAttribute("text").getValue() + ";");                        }                    }                }                if (sb.length() > 1) {                    bioEntity2IdentifierMap.put(identifier, sb.substring(0, sb.length() - 1));                }            } else {                sb = new StringBuffer();                if (srcItem.hasAttribute("name")) {                    sb.append(srcItem.getAttribute("name").getValue());                    bioEntity2IdentifierMap.put(identifier, sb.toString());                }            }            //create bioEntity2FeatureMap            sb = new StringBuffer();            if (featureReporterMaps != null) {                for (Iterator i = featureReporterMaps.getRefIds().iterator(); i.hasNext(); ) {                    //FeatureReporterMap //desc2                    Item frm = ItemHelper.convert(srcItemReader.getItemById((String) i.next()));                    if (frm.hasCollection("featureInformationSources")) {                        Iterator j = frm.getCollection("featureInformationSources").                                 getRefIds().iterator();                        //can't prefetch from FeatureReporterMap get featureInformationSources                        while (j.hasNext()) {                            Item fis = ItemHelper.convert(srcItemReader.getItemById(                                       (String) j.next()));                            if (fis.hasReference("feature")) {                                sb.append(fis.getReference("feature").getRefId() + " ");                            }                        }                    }                }                //identifier =  (String) immobilizedChar.getRefIds().get(0);                tgtItem.addReference(new Reference("material", identifier));                if (sb.length() > 1) {                    bioEntity2Feature.put(identifier, sb.substring(0, sb.length() - 1));                }                LOG.debug("bioEntity2Feature" + bioEntity2Feature.toString());            }        }    }