Package org.opengrok.indexer.analysis
Interface FileAnalyzerFactory.Matcher
- All Known Implementing Classes:
 DocumentMatcher,ZipMatcherBase
- Enclosing class:
 FileAnalyzerFactory
public static interface FileAnalyzerFactory.Matcher
Interface for matchers which map file contents to analyzer factories.
- 
Method Summary
Modifier and TypeMethodDescriptiondefault StringGets a default, reportable description of the matcher.Gets the instance which the matcher produces ifisMagic(byte[], java.io.InputStream)matches a file.isMagic(byte[] contents, InputStream in) Try to match the file contents with an analyzer factory.default booleanGet a value indicating if the magic is byte-precise. 
- 
Method Details
- 
isPreciseMagic
default boolean isPreciseMagic()Get a value indicating if the magic is byte-precise.- Returns:
 - true if precise
 
 - 
description
Gets a default, reportable description of the matcher.Subclasses can override to report a more informative description, with line length up to 50 characters before starting a new line with
\n.- Returns:
 - a defined, reportable String
 
 - 
isMagic
Try to match the file contents with an analyzer factory. If the method reads from the input stream, it must reset the stream before returning.- Parameters:
 contents- the first few bytes of a filein- the input stream from which the full file can be read- Returns:
 - an analyzer factory if the contents match, or 
nullif they don't match any factory known by this matcher - Throws:
 IOException- in case of any read error
 - 
forFactory
AnalyzerFactory forFactory()Gets the instance which the matcher produces ifisMagic(byte[], java.io.InputStream)matches a file.- Returns:
 - a defined instance
 
 
 -