class MandocAnalyzerFactory extends FileAnalyzerFactory {

    private static final String NAME = "Manual pages";

    public static final Matcher MATCHER = new Matcher() {
        @Override
        public AnalyzerFactory isMagic(byte[] contents, InputStream in)
                throws IOException {<FILL_FUNCTION_BODY>}

        @Override
        public AnalyzerFactory forFactory() {
            return getTrueMenMatcher().forFactory();
        }
    };

    public static final MandocAnalyzerFactory DEFAULT_INSTANCE =
        new MandocAnalyzerFactory();

    protected MandocAnalyzerFactory() {
        super(null, null, null, null, MATCHER, "text/plain", AbstractAnalyzer.Genre.PLAIN, NAME, true);
    }

    @Override
    protected AbstractAnalyzer newAnalyzer() {
        return new MandocAnalyzer(this);
    }

    // Because DEFAULT_INSTANCE during its initialization uses the MATCHER,
    // while at the same time the DocumentMatcher in its initialization takes
    // a FileAnalyzerFactory, and because we want the instances to be the same
    // instance, then defer initialization of the DocumentMatcher using the
    // "16.6 Lazy initialization holder class idiom," written by Brian Goetz
    // and Tim Peierls with assistance from members of JCP JSR-166 Expert Group
    // and released to the public domain, as explained at
    // http://creativecommons.org/licenses/publicdomain .
    private static class TrueMatcherHolder {
        /**
         * The prologue, which consists of the Dd, Dt, and Os macros in that
         * order, is required for every document.
         *
         * As {@link TroffXref} does not present mdoc(5) documents well, even
         * if no mandoc binary is configured, then we want a
         * {@link MandocAnalyzer} that presents a plain-text cross-referencing.
         */
        public static final DocumentMatcher MDOCMATCHER = new DocumentMatcher(
            DEFAULT_INSTANCE, new String[] {".Dd", ".Dt", ".Os"});

        /**
         * As with {@code MDOCMATCHER} except that when a mandoc binary is
         * configured, then man(5) documents with a .TH also will use the
         * {@link MandocAnalyzer}.
         */
        public static final DocumentMatcher MENMATCHER = new DocumentMatcher(
            DEFAULT_INSTANCE, new String[] {".Dd", ".Dt", ".Os", ".TH"});
    }

    /** Gets a matcher that is mdoc(5)-specific. */
    private static DocumentMatcher getTrueMdocMatcher() {
        return TrueMatcherHolder.MDOCMATCHER;
    }

    /** Gets a matcher that matches mdoc(5) and man(5). */
    private static DocumentMatcher getTrueMenMatcher() {
        return TrueMatcherHolder.MENMATCHER;
    }
}

            return RuntimeEnvironment.getInstance().getMandoc() != null ?
                getTrueMenMatcher().isMagic(contents, in) :
                getTrueMdocMatcher().isMagic(contents, in);
        
<methods>public final org.opengrok.indexer.analysis.AbstractAnalyzer getAnalyzer() ,public java.lang.String getName() ,public void returnAnalyzer() <variables>private final non-sealed java.lang.String name