Class JavaClassAnalyzer
java.lang.Object
org.apache.lucene.analysis.Analyzer
org.opengrok.indexer.analysis.AbstractAnalyzer
org.opengrok.indexer.analysis.FileAnalyzer
org.opengrok.indexer.analysis.executables.JavaClassAnalyzer
- All Implemented Interfaces:
Closeable,AutoCloseable
Analyzes Java Class files.
Created on September 23, 2005
- Author:
- Chandan, Lubos Kosco , January 2010 , updated bcel, comment on thread safety
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opengrok.indexer.analysis.AbstractAnalyzer
AbstractAnalyzer.GenreNested classes/interfaces inherited from class org.apache.lucene.analysis.Analyzer
org.apache.lucene.analysis.Analyzer.ReuseStrategy, org.apache.lucene.analysis.Analyzer.TokenStreamComponents -
Field Summary
Fields inherited from class org.opengrok.indexer.analysis.AbstractAnalyzer
countsAggregator, ctags, DUMMY_READER, factory, foldingEnabled, project, scopesEnabled, symbolTokenizerFactoryFields inherited from class org.apache.lucene.analysis.Analyzer
GLOBAL_REUSE_STRATEGY, PER_FIELD_REUSE_STRATEGY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedJavaClassAnalyzer(AnalyzerFactory factory) Creates a new instance of JavaClassAnalyzer. -
Method Summary
Modifier and TypeMethodDescriptionvoidanalyze(org.apache.lucene.document.Document doc, StreamSource src, Writer xrefOut) Analyze the contents of a source file.constantToString(org.apache.bcel.classfile.Constant c, org.apache.bcel.classfile.ConstantPool cp, int[] v) Subclasses should override to return the case-insensitive name aligning with either a built-in Universal Ctags language name or an OpenGrok custom language name.protected intGets a version number to be used to tag processed documents so that re-analysis can be re-done later if a stored version number is different from the current implementation.protected Stringprotected Stringprotected StringMethods inherited from class org.opengrok.indexer.analysis.FileAnalyzer
addNumLinesLOC, createComponents, getFileTypeName, getVersionNo, normalize, supportsScopes, writeXrefMethods inherited from class org.opengrok.indexer.analysis.AbstractAnalyzer
getFactory, getGenre, setCountsAggregator, setCtags, setFoldingEnabled, setProject, setScopesEnabledMethods inherited from class org.apache.lucene.analysis.Analyzer
attributeFactory, close, getOffsetGap, getPositionIncrementGap, getReuseStrategy, initReader, initReaderForNormalization, normalize, tokenStream, tokenStream
-
Constructor Details
-
JavaClassAnalyzer
Creates a new instance of JavaClassAnalyzer.- Parameters:
factory- The factory that creates JavaClassAnalyzers
-
-
Method Details
-
getCtagsLang
Description copied from class:AbstractAnalyzerSubclasses should override to return the case-insensitive name aligning with either a built-in Universal Ctags language name or an OpenGrok custom language name.- Overrides:
getCtagsLangin classFileAnalyzer- Returns:
nullas there is no aligned language
-
getSpecializedVersionNo
protected int getSpecializedVersionNo()Gets a version number to be used to tag processed documents so that re-analysis can be re-done later if a stored version number is different from the current implementation.- Overrides:
getSpecializedVersionNoin classAbstractAnalyzer- Returns:
- 20180612_00
-
analyze
public void analyze(org.apache.lucene.document.Document doc, StreamSource src, Writer xrefOut) throws IOException Description copied from class:FileAnalyzerAnalyze the contents of a source file. This includes populating the Lucene document with fields to add to the index, and writing the cross-referenced data to the specified destination.- Overrides:
analyzein classFileAnalyzer- Parameters:
doc- the Lucene documentsrc- the input data sourcexrefOut- where to write the xref (may benull)- Throws:
IOException- if any I/O error
-
linkPath
-
linkDef
-
tagDef
-
constantToString
public String constantToString(org.apache.bcel.classfile.Constant c, org.apache.bcel.classfile.ConstantPool cp, int[] v) throws org.apache.bcel.classfile.ClassFormatException - Throws:
org.apache.bcel.classfile.ClassFormatException
-