public class SrcTreeProcessor
extends Object
XMLTextProcessor
class to actually split the source files up into chunks and add them to the
Lucene index.Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
SrcTreeProcessor()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
(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.
|
private void |
outputRaw(IndexSource src)
Dump preprocessed source data to stdout; used in prefilterOnly mode.
|
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.
|
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
public SrcTreeProcessor()
XMLTextProcessor
used internally to process individual XML source files. 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. private void outputRaw(IndexSource src) throws Exception
src
- The XML index source to dump Exception