public void decodeEvents(final String document, LogDataCollector collector, ParsingContext parsingContext) {

    if (document != null) {

      if (document.trim().equals("")) {
        return;
      }

      String newDoc;
      String newPartialEvent;
      // separate the string into the last portion ending with </record>
      // (which will be processed) and the partial event which
      // will be combined and processed in the next section

      String partialEvent = (String) parsingContext.getCustomConextProperties().get(PARTIAL_EVENT);
      // if the document does not contain a record end,
      // append it to the partial event string
      if (document.lastIndexOf(RECORD_END) == -1) {
        partialEvent = partialEvent + document;
        parsingContext.getCustomConextProperties().put(PARTIAL_EVENT, partialEvent);
        return;
      }

      if (document.lastIndexOf(RECORD_END) + RECORD_END.length() < document.length()) {
        newDoc = document.substring(0, document.lastIndexOf(RECORD_END) + RECORD_END.length());
        newPartialEvent = document.substring(document.lastIndexOf(RECORD_END) + RECORD_END.length());
        parsingContext.getCustomConextProperties().put(PARTIAL_EVENT, newPartialEvent);
      } else {
        newDoc = document;
      }
      if (partialEvent != null) {
        newDoc = partialEvent + newDoc;
      }

      Document doc = parse(newDoc, (DocumentBuilder) parsingContext.getCustomConextProperties().get(DOC_BUILDER));
      if (doc == null) {
        return;
      }
      decodeEvents(doc, collector, parsingContext);
    }
  }
Decodes a String representing a number of events into a Vector of LoggingEvents.

@param document to decode events from
olv-core/src/main/java/pl/otros/logview/importer/UtilLoggingXmlLogImporter.java