KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > jpivot > table > TableComponentFactory


1 /*
2  * ====================================================================
3  * This software is subject to the terms of the Common Public License
4  * Agreement, available at the following URL:
5  * http://www.opensource.org/licenses/cpl.html .
6  * Copyright (C) 2003-2004 TONBELLER AG.
7  * All Rights Reserved.
8  * You must accept the terms of that agreement to use this software.
9  * ====================================================================
10  *
11  *
12  */

13 package com.tonbeller.jpivot.table;
14
15 import java.io.IOException JavaDoc;
16 import java.net.URL JavaDoc;
17
18 import org.xml.sax.SAXException JavaDoc;
19
20 import com.tonbeller.jpivot.olap.model.OlapModel;
21 import com.tonbeller.wcf.utils.ObjectFactory;
22
23 /**
24  * creates a tablecomponent from xml configuration file
25  *
26  * @author av
27  */

28 public class TableComponentFactory {
29
30   private TableComponentFactory() { }
31
32   public static TableComponent instance(String JavaDoc id, URL JavaDoc configXml, OlapModel olapModel) throws IOException JavaDoc, SAXException JavaDoc {
33     URL JavaDoc rulesXml = TableComponent.class.getResource("rules.xml");
34     TableComponent table = (TableComponent) ObjectFactory.instance(rulesXml, configXml);
35     table.setOlapModel(olapModel);
36     table.setId(id);
37     return table;
38   }
39
40
41 }
42
Popular Tags