TroffAnalyzerFactory.java revision 5321cd178c121fcb737d72986ab0c991b9e6ffca
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen/*
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner * CDDL HEADER START
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner *
9ec7787531611654e8f50932473aa48963eaba55Trond Norbye * The contents of this file are subject to the terms of the
9ec7787531611654e8f50932473aa48963eaba55Trond Norbye * Common Development and Distribution License (the "License").
9ec7787531611654e8f50932473aa48963eaba55Trond Norbye * You may not use this file except in compliance with the License.
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen *
9ec7787531611654e8f50932473aa48963eaba55Trond Norbye * See LICENSE.txt included in this distribution for the specific
9ec7787531611654e8f50932473aa48963eaba55Trond Norbye * language governing permissions and limitations under the License.
9ec7787531611654e8f50932473aa48963eaba55Trond Norbye *
9ec7787531611654e8f50932473aa48963eaba55Trond Norbye * When distributing Covered Code, include this CDDL HEADER in each
9ec7787531611654e8f50932473aa48963eaba55Trond Norbye * file and include the License file at LICENSE.txt.
9ec7787531611654e8f50932473aa48963eaba55Trond Norbye * If applicable, add the following below this CDDL HEADER, with the
9ec7787531611654e8f50932473aa48963eaba55Trond Norbye * fields enclosed by brackets "[]" replaced with your own identifying
9ec7787531611654e8f50932473aa48963eaba55Trond Norbye * information: Portions Copyright [yyyy] [name of copyright owner]
9ec7787531611654e8f50932473aa48963eaba55Trond Norbye *
9ec7787531611654e8f50932473aa48963eaba55Trond Norbye * CDDL HEADER END
9ec7787531611654e8f50932473aa48963eaba55Trond Norbye */
9ec7787531611654e8f50932473aa48963eaba55Trond Norbye
9ec7787531611654e8f50932473aa48963eaba55Trond Norbye/*
9158900bac6adc966217d308f9ddea9f5eb540c7Kryštof Tulinger * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner * Use is subject to license terms.
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner */
9158900bac6adc966217d308f9ddea9f5eb540c7Kryštof Tulinger
9158900bac6adc966217d308f9ddea9f5eb540c7Kryštof Tulingerpackage org.opensolaris.opengrok.analysis.document;
9158900bac6adc966217d308f9ddea9f5eb540c7Kryštof Tulinger
14a41f02433890d19b2f871156271e3388cd0845Jens Elknerimport java.io.IOException;
14a41f02433890d19b2f871156271e3388cd0845Jens Elknerimport java.io.InputStream;
14a41f02433890d19b2f871156271e3388cd0845Jens Elknerimport java.io.Writer;
14a41f02433890d19b2f871156271e3388cd0845Jens Elknerimport org.opensolaris.opengrok.analysis.FileAnalyzer;
14a41f02433890d19b2f871156271e3388cd0845Jens Elknerimport org.opensolaris.opengrok.analysis.FileAnalyzer.Genre;
14a41f02433890d19b2f871156271e3388cd0845Jens Elknerimport org.opensolaris.opengrok.analysis.FileAnalyzerFactory;
14a41f02433890d19b2f871156271e3388cd0845Jens Elknerimport org.opensolaris.opengrok.configuration.Project;
14a41f02433890d19b2f871156271e3388cd0845Jens Elknerimport org.opensolaris.opengrok.history.Annotation;
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlenpublic class TroffAnalyzerFactory extends FileAnalyzerFactory {
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen private static final String[] MAGICS = {
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen "'\\\"", ".so", ".\\\"", ".TH"
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen };
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen public TroffAnalyzerFactory() {
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen super(null, MAGICS, null, "text/plain", Genre.PLAIN);
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen }
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen
9158900bac6adc966217d308f9ddea9f5eb540c7Kryštof Tulinger @Override
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen protected FileAnalyzer newAnalyzer() {
59b6a8c0cc6ef741a7180504b3c371e67c2aa338Knut Anders Hatlen return new TroffAnalyzer(this);
9ec7787531611654e8f50932473aa48963eaba55Trond Norbye }
14a41f02433890d19b2f871156271e3388cd0845Jens Elkner
c0550b01024b910b8c1468811c0ea663b10b1372Trond Norbye @Override
public void writeXref(InputStream in, Writer out, Annotation annotation, Project project)
throws IOException
{
TroffAnalyzer.writeXref(in, out, annotation, project);
}
}