Source code: jbreport/Repository.java
1 /*
2 * $Id: Repository.java,v 1.1.1.1 2000/08/31 13:14:26 grantfin Exp $
3 *
4 * jbReport - A reporting library for Java
5 * Copyright (C) 2000 Grant Finnemore <grantfin@users.sourceforge.net>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21 package jbreport;
22
23 import java.util.HashMap;
24 import java.util.Iterator;
25 import java.util.Map;
26 import org.xml.sax.Attributes;
27
28 /**
29 * This represents a storage area for a bunch of other element types, including
30 * but not limited to, datasources, queries, documents, etc.
31 *
32 * <p> It should be noted that a repository forms its' own namespace, and that
33 * elements such as queries can be obtained by referring to a given namespace.
34 * ie. should a Query x be required from Repository y, we can either get
35 * Repository y, and then call <code>getQuery("x")</code> on it, or if we
36 * already have a Repository z, then the call <code>getQuery("y.x")</code> will
37 * return the same Query element.
38 *
39 * @author Grant Finnemore
40 * @version $Revision: 1.1.1.1 $
41 */
42 public
43 interface Repository extends ReportComposite {
44
45 /**
46 * Returns the document for the given name, if one exists. The name can
47 * be in a different namespace, in which case the appropriate lookup will
48 * be performed by the framework.
49 *
50 * @throws ReportException if the document does not exist for the given
51 * name.
52 */
53 public ReportSection fetchDocument(String name) throws ReportException;
54
55 /**
56 * Returns an iterator over the available document names within this
57 * repository, although the caller should check the <code>iterator.hasNext
58 * ()</code> method is not false on return. This would indicate that there
59 * are no defined documents in this repository.
60 *
61 * <p> The iterator returned does not support the <code>remove()</code>
62 * method.
63 */
64 public Iterator documentNames();
65
66 /**
67 * Returns the fragment for the given name, if one exists. The name can
68 * be in a different namespace, in which case the appropriate lookup will
69 * be performed by the framework.
70 *
71 * @throws ReportException if the document does not exist for the given
72 * name.
73 */
74 public ReportElement fetchFragment(String name) throws ReportException;
75
76 /**
77 * Returns the stylesheet for the given name, if one exists. The name can
78 * be in a different namespace, in which case the appropriate lookup will
79 * be performed by the framework.
80 *
81 * @throws ReportException if the document does not exist for the given
82 * name.
83 */
84 public ReportStylesheet fetchStylesheet(String name) throws ReportException;
85
86 }
87
88
89
90