View Javadoc

1   /*
2       StatCvs - CVS statistics generation 
3       Copyright (C) 2002  Lukasz Pekacki <lukasz@pekacki.de>
4       http://statcvs.sf.net/
5       
6       This library is free software; you can redistribute it and/or
7       modify it under the terms of the GNU Lesser General Public
8       License as published by the Free Software Foundation; either
9       version 2.1 of the License, or (at your option) any later version.
10  
11      This library is distributed in the hope that it will be useful,
12      but WITHOUT ANY WARRANTY; without even the implied warranty of
13      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14      Lesser General Public License for more details.
15  
16      You should have received a copy of the GNU Lesser General Public
17      License along with this library; if not, write to the Free Software
18      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19      
20  	$RCSfile: CssHandler.java,v $
21  	$Date: 2008/04/02 11:22:15 $ 
22  */
23  package net.sf.statcvs.output;
24  
25  import java.io.IOException;
26  
27  /**
28   * Manager for the handling of CSS files. There are different ways for speciying
29   * CSS files (local file, default file from the distribution JAR, HTTP URL).
30   * A CssHandler must be implemented for each of these ways.
31   * 
32   * TODO: Should be refactored into something that produces a ReportFile, which
33   * 		has methods getURL() and write() and can be added to report pages.
34   * 
35   * @author Richard Cyganiak
36   */
37  public interface CssHandler {
38  
39      /**
40       * returns a link to the CSS file, which can be used as the HREF in HTML's
41       * &lt;LINK REL="stylesheet"&gt HREF="filename.css";.
42       * 
43       * @return a link to the CSS file
44       */
45      String getLink();
46  
47      /**
48       * Checks if all necessary resources are available. This can be
49       * used, for example, to check if a local CSS file really exists
50       * or if a HTTP URL is valid.   
51       *
52       * @throws ConfigurationException if some resource is missing. 
53       */
54      void checkForMissingResources() throws ConfigurationException;
55  
56      /**
57       * Creates any necessary output files.
58       * 
59       * @throws IOException if an output file can't be created
60       */
61      void createOutputFiles() throws IOException;
62  }