01: // THIS SOFTWARE IS PROVIDED BY SOFTARIS PTY.LTD. AND OTHER METABOSS
02: // CONTRIBUTORS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
03: // BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
04: // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SOFTARIS PTY.LTD.
05: // OR OTHER METABOSS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
06: // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
07: // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
08: // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
09: // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
10: // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
11: // EVEN IF SOFTARIS PTY.LTD. OR OTHER METABOSS CONTRIBUTORS ARE ADVISED OF THE
12: // POSSIBILITY OF SUCH DAMAGE.
13: //
14: // Copyright 2000-2005 © Softaris Pty.Ltd. All Rights Reserved.
15: package com.metaboss.sdlctools.domains.enterprisemodel.impl;
16:
17: import com.metaboss.enterprise.bo.BOException;
18: import com.metaboss.sdlctools.domains.enterprisemodel.BOReport;
19: import com.metaboss.sdlctools.domains.enterprisemodel.BOReportEntityList;
20: import com.metaboss.sdlctools.domains.enterprisemodel.BOReportOutputElement;
21: import com.metaboss.sdlctools.domains.enterprisemodel.BOReportOutputFieldList;
22: import com.oldboss.framework.bo.impl.BOObjectImpl;
23:
24: public class BOReportOutputElementImpl extends BOObjectImpl implements
25: BOReportOutputElement {
26: protected BOMetaBossDomainImpl mMetaBossDomainImpl = null;
27: private BOReport mOwnerReport = null;
28: private int mLevel = -1;
29:
30: /* Instance creator */
31: public static BOReportOutputElement createInstanceForExisting(
32: BOMetaBossDomainImpl pMetaBossDomainImpl,
33: BOReport pOwnerReport, int pLevel) throws BOException {
34: BOReportOutputElementImpl lImpl = new BOReportOutputElementImpl();
35: lImpl.mMetaBossDomainImpl = pMetaBossDomainImpl;
36: lImpl.mOwnerReport = pOwnerReport;
37: lImpl.mLevel = pLevel;
38: lImpl.setupForExisting();
39: return lImpl;
40: }
41:
42: /* Private constructor restricts instance creation from outside */
43: private BOReportOutputElementImpl() throws BOException {
44: }
45:
46: /* Retrieves unique reference */
47: public BOReport getReport() throws BOException {
48: return mOwnerReport;
49: }
50:
51: /** Retrives level index of this element. Zero means that this is the top level report element */
52: public int getLevel() throws BOException {
53: return mLevel;
54: }
55:
56: /* Retireves the list of output fields */
57: public BOReportOutputFieldList getFields() throws BOException {
58: return BOReportOutputFieldListImpl.createInstanceForExisting(
59: mMetaBossDomainImpl, mOwnerReport, mLevel);
60: }
61:
62: /** Retireves the list of top level output entities */
63: public BOReportEntityList getEntities() throws BOException {
64: return BOReportEntityListImpl.createInstanceForExisting(
65: mMetaBossDomainImpl, mOwnerReport, mLevel);
66: }
67:
68: /** Retireves possible sub element of the report */
69: public BOReportOutputElement getSubElement() throws BOException {
70: if (mOwnerReport.getOutputLevels() > mLevel)
71: return BOReportOutputElementImpl.createInstanceForExisting(
72: mMetaBossDomainImpl, mOwnerReport, mLevel + 1);
73: else
74: return null;
75: }
76: }
|