ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco/*
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco * CDDL HEADER START
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco *
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco * The contents of this file are subject to the terms of the
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco * Common Development and Distribution License (the "License").
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco * You may not use this file except in compliance with the License.
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco *
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco * See LICENSE.txt included in this distribution for the specific
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco * language governing permissions and limitations under the License.
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco *
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco * When distributing Covered Code, include this CDDL HEADER in each
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco * file and include the License file at LICENSE.txt.
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco * If applicable, add the following below this CDDL HEADER, with the
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco * fields enclosed by brackets "[]" replaced with your own identifying
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco * information: Portions Copyright [yyyy] [name of copyright owner]
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco *
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco * CDDL HEADER END
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco */
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco/*
eb11fe3584b7b243fb0641da4ab2e157610bb767Lubos Kosco * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco */
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Koscopackage org.opensolaris.opengrok.analysis.javascript;
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Koscoimport java.io.IOException;
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Koscoimport java.io.Reader;
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Koscoimport java.io.Writer;
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Koscoimport org.opensolaris.opengrok.analysis.Definitions;
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Koscoimport org.opensolaris.opengrok.analysis.FileAnalyzer;
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Koscoimport org.opensolaris.opengrok.analysis.FileAnalyzer.Genre;
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Koscoimport org.opensolaris.opengrok.analysis.FileAnalyzerFactory;
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Koscoimport org.opensolaris.opengrok.configuration.Project;
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Koscoimport org.opensolaris.opengrok.history.Annotation;
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Koscopublic class JavaScriptAnalyzerFactory extends FileAnalyzerFactory {
eb11fe3584b7b243fb0641da4ab2e157610bb767Lubos Kosco
eb11fe3584b7b243fb0641da4ab2e157610bb767Lubos Kosco private static final String name = "JavaScript";
eb11fe3584b7b243fb0641da4ab2e157610bb767Lubos Kosco
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco private static final String[] SUFFIXES = {
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco "JS"
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco };
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco private static final String[] MAGICS = {
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco };
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco public JavaScriptAnalyzerFactory() {
eb11fe3584b7b243fb0641da4ab2e157610bb767Lubos Kosco super(null, null, SUFFIXES, MAGICS, null, "text/plain", Genre.PLAIN, name);
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco }
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco @Override
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco protected FileAnalyzer newAnalyzer() {
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco return new JavaScriptAnalyzer(this);
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco }
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco @Override
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco public void writeXref(Reader in, Writer out, Definitions defs, Annotation annotation, Project project)
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco throws IOException {
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco JavaScriptAnalyzer.writeXref(in, out, defs, annotation, project);
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco }
ecc9697029dc3bde02537b914756f7c49eb7cd1eLubos Kosco}