01: package org.netbeans.modules.reportgenerator.api;
02:
03: /**
04: * ReportElementFactory is the factory to create
05: * various Report objects which are then populated
06: * by a domain model for report generation.
07: * @author radval
08: *
09: */
10: public abstract class ReportElementFactory {
11:
12: private static ReportElementFactory mInstance;
13:
14: /**
15: * Get the default ReportElementFactory factory
16: * @return
17: * @throws ReportException
18: */
19: public static ReportElementFactory getDefault()
20: throws ReportException {
21:
22: if (mInstance == null) {
23:
24: String implClass = System
25: .getProperty(
26: "org.netbeans.modules.reportgenerator.api.ReportElementFactory",
27: "org.netbeans.modules.reportgenerator.api.impl.ReportElementFactoryImpl");
28: try {
29:
30: Class cls = Class.forName(implClass);
31: mInstance = (ReportElementFactory) cls.newInstance();
32:
33: } catch (Exception ex) {
34: throw new ReportException(
35: "Failed to create ReportGeneratorFactory", ex);
36: }
37:
38: }
39: return mInstance;
40: }
41:
42: /**
43: * create Report.
44: * @return
45: */
46: public abstract Report createReport();
47:
48: /**
49: * create ReportHeader.
50: * @return
51: */
52: public abstract ReportHeader createReportHeader();
53:
54: /**
55: * create ReportBody.
56: * @return
57: */
58: public abstract ReportBody createReportBody();
59:
60: /**
61: * create ReportFooter.
62: * @return
63: */
64: public abstract ReportFooter createReportFooter();
65:
66: /**
67: * create ReportSection.
68: * @return
69: */
70: public abstract ReportSection createReportSection();
71:
72: /**
73: * create ReportElement.
74: * @return
75: */
76: public abstract ReportElement createReportElement();
77:
78: /**
79: * create ReportAttribute.
80: * @return
81: */
82: public abstract ReportAttribute createReportAttribute();
83:
84: }
|