|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectSrcTreeProcessor
public class SrcTreeProcessor
This class is the main processing shell for files in the source text
tree. It optimizes Lucene database access by opening the index once at
the beginning, processing all the source files in the source tree
(including skipping non-source XML files in the tree), and closing the
database at the end.
Internally, this class uses the XMLTextProcessor
class to actually split the source files up into chunks and add them to the
Lucene index.
Field Summary | |
---|---|
private IndexerConfig |
cfgInfo
|
private StringBuffer |
dirBuf
|
private StringBuffer |
docBuf
|
private DocSelCache |
docSelCache
|
private File |
docSelCacheFile
|
private Templates |
docSelector
|
private String |
docSelPath
|
private int |
nScanned
|
private StylesheetCache |
stylesheetCache
|
private XMLTextProcessor |
textProcessor
|
Constructor Summary | |
---|---|
SrcTreeProcessor()
Default constructor. |
Method Summary | |
---|---|
(package private) String |
calcIndexPath()
|
void |
close()
Indexing close function. |
void |
loadCache(IndexerConfig cfgInfo)
Load the previous docSelector cache. |
void |
open(IndexerConfig cfgInfo)
Indexing open function. |
void |
processDir(File curDir,
SubDirFilter subDirFilter,
boolean topLevel)
Process a directory containing source XML files. |
boolean |
processFile(String dir,
EasyNode parentEl)
Process file. |
void |
saveCache()
Save the docSelector cache. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private IndexerConfig cfgInfo
private XMLTextProcessor textProcessor
private StylesheetCache stylesheetCache
private Templates docSelector
private int nScanned
private StringBuffer docBuf
private StringBuffer dirBuf
private String docSelPath
private File docSelCacheFile
private DocSelCache docSelCache
Constructor Detail |
---|
public SrcTreeProcessor()
XMLTextProcessor
used internally to process individual XML source files.
Method Detail |
---|
public void open(IndexerConfig cfgInfo) throws Exception
XMLTextProcessor
open()
method to actually create/open the Lucene index.
cfgInfo
- The IndexerConfig
that indentifies the Lucene index, source text tree, and
other parameters required to perform indexing. IOException
- Any I/O exceptions generated by the
XMLTextProcessor
open()
method. Exception
public void close() throws IOException
XMLTextProcessor
processQueuedTexts()
method to flush all the pending Lucene writes to disk. Then it calls the
XMLTextProcessor
close()
method to actually close the Lucene index.
IOException
- Any I/O exceptions generated by the
XMLTextProcessor
close()
method. String calcIndexPath()
public void loadCache(IndexerConfig cfgInfo)
cfgInfo
- The IndexerConfig
that indentifies the Lucene index, source text tree, and
other parameters required to perform indexing. public void saveCache()
public void processDir(File curDir, SubDirFilter subDirFilter, boolean topLevel) throws Exception
curDir
- The current directory to be processed. subDirFilter
- Sub-dirs to scan, or null for all. topLevel
- true for the top-level directory, false else. Exception
- Any exceptions generated internally
by the File
class or the
XMLTextProcessor
class. public boolean processFile(String dir, EasyNode parentEl) throws Exception
parentEl
- DOM element representing the current file to be
processed. This may be a source XML file, PDF file,
etc. Exception
- Any exceptions generated internally by the File
class or the XMLTextProcessor
class.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |