Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: info/crossbar/view/formatter/FormatterAbstraction.java


1   /*
2    *  @(#)FormatterAbstraction.java $Revision: 1.3 $ $Date: 2003/06/04 04:55:32 $
3    *
4    *  Copyright 2002 by Daniel Kehoe <kehoe@fortuity.com>
5    *  All Rights Reserved
6    *
7    *  Redistribution and use in source and binary forms, with or without
8    *  modification, are permitted provided that the following conditions
9    *  are met:
10   *  1. Redistributions of source code must retain the above copyright
11   *  notice, this list of conditions and the following disclaimer.
12   *  2. Redistributions in binary form must reproduce the above copyright
13   *  notice, this list of conditions and the following disclaimer in the
14   *  documentation and/or other materials provided with the distribution.
15   *
16   *  THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17   *  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18   *  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19   *  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20   *  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21   *  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22   *  OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23   *  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24   *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25   *  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26   *  SUCH DAMAGE.
27   */
28  package info.crossbar.view.formatter;
29  
30  import java.util.logging.Logger;
31  import java.io.*;
32  
33  import java.util.*;
34  
35  import java.text.*;
36  
37  import javax.servlet.http.HttpServletRequest;
38  import javax.servlet.http.HttpSession;
39  import javax.servlet.ServletException;
40  
41  import java.sql.SQLException;
42  
43  import sun.jdbc.rowset.*;
44  
45  /**
46   * FormatterAbstraction interface for use by <a href="http://www.crossbar.info/">Crossbar</a>
47   *
48   * @author     Daniel Kehoe, <a href="http://www.fortuity.com/">Fortuity Consulting</a>
49   * @created    January 23, 2002
50   * @version    <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/crossbar/crossbar-sitemap/src/java/info/crossbar/view/formatter/FormatterAbstraction.java">View source, revision history</a>
51   * $Revision: 1.3 $ $Date: 2003/06/04 04:55:32 $
52   * <p>
53   * DESCRIPTION:
54   * This is an interface that allows us to load a class dynamically using the
55   * Class.forName method. Classes that implement this interface are used to mix
56   * markup and content for inclusion on a JSP page.
57   */
58  public interface FormatterAbstraction {
59  
60    /**
61     * Given a CachedRowSet containing tabular data, iterate through each row
62     * and column, obtaining each field value and wrapping it with markup (for
63     * example, HTML tags) to be returned as a string to a custom tag for
64     * inclusion on a jsp page.
65     * (INTERFACE ONLY.)
66     *
67     * @param  request               the HttpServletRequest for any needed parameters
68     * @param  table                 a CachedRowSet object
69     * @param  headerstyle           String that specifies a CSS table header style
70     * @param  bodystyle             String that specifies a CSS table body style
71     * @param  footerstyle           String that specifies a CSS table header style
72     * @return                       String suitable for output by a custom tag
73     * @exception  ServletException  thrown by any error
74     */
75    public String markup(HttpServletRequest request, CachedRowSet table, 
76      String headerstyle, String bodystyle, String footerstyle)
77      throws ServletException;
78  
79    /**
80     * Obtain information on this class.
81     *
82     * @return    String describing this class.
83     */
84    public String getClassInfo();
85  
86  }
87