|
|||||||||
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.
Nested Class Summary | |
---|---|
(package private) static class |
SrcTreeProcessor.CacheEntry
One entry in the docSelector cache |
Field Summary | |
---|---|
private IndexerConfig |
cfgInfo
|
private StringBuffer |
dirBuf
|
private StringBuffer |
docBuf
|
private HashMap |
docSelCache
|
private File |
docSelCacheFile
|
private String |
docSelDependencies
|
private Templates |
docSelector
|
private String |
docSelPath
|
private int |
nScanned
|
private StylesheetCache |
stylesheetCache
|
private XMLTextProcessor |
textProcessor
|
Constructor Summary | |
---|---|
SrcTreeProcessor()
Default constructor. |
Method Summary | |
---|---|
void |
close()
Indexing close function. |
void |
loadCache(IndexerConfig cfgInfo)
Load the previous docSelector cache. |
void |
open(IndexerConfig cfgInfo)
Indexing open function. |
void |
processDir(File currFile,
int level)
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 String docSelDependencies
private File docSelCacheFile
private HashMap 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. 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 currFile, int level) throws Exception
currFile
- The current file to be processed. This may be a source
XML file, a file to be skipped, or a subdirectory. level
- The directory level we're currently processing (zero
for top-level, 1 for its children, etc.) 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 |