org.opensolaris.opengrok.analysis
Class FileAnalyzer
java.lang.Object
org.apache.lucene.analysis.Analyzer
org.opensolaris.opengrok.analysis.FileAnalyzer
- All Implemented Interfaces:
- java.io.Closeable
- Direct Known Subclasses:
- BZip2Analyzer, ELFAnalyzer, GZIPAnalyzer, JarAnalyzer, JavaClassAnalyzer, TarAnalyzer, TextAnalyzer, TroffAnalyzer, ZipAnalyzer
public class FileAnalyzer
- extends org.apache.lucene.analysis.Analyzer
Base class for all different File Analyzers
An Analyzer for a filetype provides
- the file extentions and magic numbers it analyzes
- a lucene document listing the fields it can support
- TokenStreams for each of the field it said requires tokenizing in 2
- cross reference in HTML format
- The type of file data, plain text etc
Created on September 21, 2005
Fields inherited from class org.apache.lucene.analysis.Analyzer |
overridesTokenStreamMethod |
Methods inherited from class org.apache.lucene.analysis.Analyzer |
close, getOffsetGap, getPositionIncrementGap, getPreviousTokenStream, reusableTokenStream, setOverridesTokenStreamMethod, setPreviousTokenStream |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
project
protected Project project
ctags
protected Ctags ctags
FileAnalyzer
public FileAnalyzer(FileAnalyzerFactory factory)
- Creates a new instance of FileAnalyzer
setCtags
public void setCtags(Ctags ctags)
setProject
public void setProject(Project project)
getFactory
public final FileAnalyzerFactory getFactory()
- Get the factory which created this analyzer.
- Returns:
- the
FileAnalyzerFactory
which created this analyzer
getGenre
public FileAnalyzer.Genre getGenre()
analyze
public void analyze(org.apache.lucene.document.Document doc,
java.io.InputStream in)
throws java.io.IOException
- Throws:
java.io.IOException
tokenStream
public org.apache.lucene.analysis.TokenStream tokenStream(java.lang.String fieldName,
java.io.Reader reader)
- Specified by:
tokenStream
in class org.apache.lucene.analysis.Analyzer
writeXref
public void writeXref(java.io.Writer out)
throws java.io.IOException
- Write a cross referenced HTML file.
- Parameters:
out
- to writer HTML cross-reference
- Throws:
java.io.IOException
- if an error occurs
writeXref
public void writeXref(java.io.File xrefDir,
java.lang.String path)
throws java.io.IOException
- Throws:
java.io.IOException