コード例 #1
0
 public void updateDocument(Document doc) {
   if (null != doc) {
     Document document = getDocument(doc.getId());
     if ((document instanceof DocumentStorageBean) && (doc instanceof DocumentStorageBean)) {
       ((DocumentStorageBean) document).mergeDocuments((DocumentStorageBean) doc);
     } else {
       if (null != document) {
         remove(document);
       }
       add(doc);
     }
   }
 }
コード例 #2
0
  public Document getDocument(String id) {
    Document result = null;

    for (Iterator i = iterator(); i.hasNext(); ) {
      Document doc = (Document) i.next();
      if (CompareHelper.areEqual(id, doc.getId())) {
        result = doc;
        break;
      }
    }

    return result;
  }
コード例 #3
0
 public void removeDocument(Document doc) {
   if (null != doc) {
     removeDocument(doc.getId());
   }
 }