190N/A/*
190N/A * CDDL HEADER START
190N/A *
190N/A * The contents of this file are subject to the terms of the
190N/A * Common Development and Distribution License (the "License").
190N/A * You may not use this file except in compliance with the License.
190N/A *
190N/A * See LICENSE.txt included in this distribution for the specific
190N/A * language governing permissions and limitations under the License.
190N/A *
190N/A * When distributing Covered Code, include this CDDL HEADER in each
190N/A * file and include the License file at LICENSE.txt.
190N/A * If applicable, add the following below this CDDL HEADER, with the
190N/A * fields enclosed by brackets "[]" replaced with your own identifying
190N/A * information: Portions Copyright [yyyy] [name of copyright owner]
190N/A *
190N/A * CDDL HEADER END
190N/A */
190N/A
190N/A/*
1127N/A * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
190N/A */
190N/A
190N/Apackage org.opensolaris.opengrok.analysis.sql;
190N/A
190N/Aimport java.io.IOException;
190N/Aimport java.io.Reader;
1384N/A
1127N/Aimport org.opensolaris.opengrok.analysis.Definitions;
202N/Aimport org.opensolaris.opengrok.analysis.FileAnalyzerFactory;
1384N/Aimport org.opensolaris.opengrok.analysis.XrefWriter;
190N/Aimport org.opensolaris.opengrok.analysis.plain.PlainAnalyzer;
271N/Aimport org.opensolaris.opengrok.configuration.Project;
190N/Aimport org.opensolaris.opengrok.history.Annotation;
190N/A
190N/Apublic class SQLAnalyzer extends PlainAnalyzer {
190N/A
190N/A private final SQLXref xref = new SQLXref((Reader)null);
190N/A
202N/A public SQLAnalyzer(FileAnalyzerFactory factory) {
202N/A super(factory);
202N/A }
202N/A
190N/A /**
190N/A * Write a cross referenced HTML file.
190N/A * @param out Writer to write HTML cross-reference
190N/A */
1384N/A public void writeXref(XrefWriter out) throws IOException {
190N/A xref.reInit(content, len);
271N/A xref.project = project;
561N/A xref.setDefs(defs);
190N/A xref.write(out);
190N/A }
190N/A
190N/A /**
190N/A * Write a cross referenced HTML file. Reads the source from
190N/A * an input stream.
190N/A *
190N/A * @param in input source
190N/A * @param out output xref writer
1127N/A * @param defs definitions for the file (could be null)
190N/A * @param annotation annotation for the file (could be null)
190N/A */
1384N/A static void writeXref(Reader in, XrefWriter out, Definitions defs, Annotation annotation, Project project) throws IOException {
190N/A SQLXref xref = new SQLXref(in);
190N/A xref.annotation = annotation;
271N/A xref.project = project;
1127N/A xref.setDefs(defs);
190N/A xref.write(out);
190N/A }
190N/A}