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.BOEntity;
19: import com.metaboss.sdlctools.domains.enterprisemodel.BOReport;
20: import com.metaboss.sdlctools.domains.enterprisemodel.BOReportEntity;
21: import com.metaboss.sdlctools.domains.enterprisemodel.BOReportEntityAttributeList;
22: import com.metaboss.sdlctools.domains.enterprisemodel.storage.STReportEntity;
23: import com.oldboss.framework.bo.impl.BOObjectImpl;
24:
25: public class BOReportEntityImpl extends BOObjectImpl implements
26: BOReportEntity {
27: private BOMetaBossDomainImpl mMetaBossDomainImpl = null;
28: private BOReport mReport = null;
29: private int mLevel = -1;
30: private STReportEntity mDetails = null;
31:
32: /* Instance creator */
33: public static BOReportEntity createInstanceForExisting(
34: BOMetaBossDomainImpl pMetaBossDomainImpl, BOReport pReport,
35: int pLevel, STReportEntity pDetails) throws BOException {
36: if (pReport == null)
37: throw new BOException("Empty report object is not allowed");
38: BOReportEntityImpl lImpl = new BOReportEntityImpl();
39: lImpl.mMetaBossDomainImpl = pMetaBossDomainImpl;
40: lImpl.mReport = pReport;
41: lImpl.mLevel = pLevel;
42: lImpl.mDetails = pDetails;
43: lImpl.setupForExisting();
44: return lImpl;
45: }
46:
47: /* Retrieves report this report entity belongs to. Together with name
48: * forms primary key for this object */
49: public BOReport getReport() throws BOException {
50: return mReport;
51: }
52:
53: /** Retrieves the level at which this report entity is positioned in the report */
54: public int getReportLevel() throws BOException {
55: return mLevel;
56: }
57:
58: /* Retrieves element's name. Name is only unique within parent entity */
59: public String getName() throws BOException {
60: return mDetails.Name;
61: }
62:
63: /* Retrieves plural role name */
64: public String getPluralName() throws BOException {
65: return mDetails.PluralName;
66: }
67:
68: /* Retrieves entity for which this role is described */
69: public BOEntity getEntity() throws BOException {
70: return BOEntityImpl.createInstanceForExisting(
71: mMetaBossDomainImpl, mDetails.EntityRef);
72: }
73:
74: /** Retireves attributes delivered inside this entity. */
75: public BOReportEntityAttributeList getRetrievedAttributes()
76: throws BOException {
77: return BOReportEntityAttributeListImpl
78: .createInstanceForExisting(mMetaBossDomainImpl, this );
79: }
80:
81: /* Returns element's description */
82: public String getDescription() throws BOException {
83: return mDetails.Description;
84: }
85:
86: /* Retrieves the cardinality of the report entity */
87: public com.metaboss.sdlctools.types.enterprisemodel.ReportEntityCardinality getCardinality()
88: throws BOException {
89: return mDetails.Cardinality;
90: }
91: }
|