org.exist.memtree
Class DOMIndexer

java.lang.Object
  extended byorg.exist.memtree.DOMIndexer

public class DOMIndexer
extends java.lang.Object

Helper class to make a in-memory document fragment persistent. The class directly accesses the in-memory document structure and writes it into a temporary doc on the database. This is much faster than first serializing the document tree to SAX and passing it to Collection.store(org.exist.storage.txn.Txn, org.exist.storage.DBBroker, org.exist.collections.IndexInfo, org.xml.sax.InputSource, boolean). As the in-memory document fragment may not be a well-formed XML doc (having more than one root element), a wrapper element is put around the content nodes.

Author:
wolf

Field Summary
static QName ROOT_QNAME
           
 
Constructor Summary
DOMIndexer(DBBroker broker, Txn transaction, DocumentImpl doc, DocumentImpl targetDoc)
           
 
Method Summary
 void scan()
          Scan the DOM tree once to determine its structure.
 void store()
          Store the nodes.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ROOT_QNAME

public static final QName ROOT_QNAME
Constructor Detail

DOMIndexer

public DOMIndexer(DBBroker broker,
                  Txn transaction,
                  DocumentImpl doc,
                  DocumentImpl targetDoc)
Method Detail

scan

public void scan()
          throws EXistException
Scan the DOM tree once to determine its structure.

Throws:
EXistException

store

public void store()
Store the nodes.



Copyright (C) Wolfgang Meier. All rights reserved.