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