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.BOPropertyDescriptor;
19: import com.metaboss.sdlctools.domains.enterprisemodel.BOPropertyDescriptorList;
20: import com.metaboss.sdlctools.domains.enterprisemodel.storage.STPropertyDescriptor;
21: import com.oldboss.framework.bo.impl.BOObjectImpl;
22:
23: public class BOPropertyDescriptorImpl extends BOObjectImpl implements
24: BOPropertyDescriptor {
25: private BOMetaBossDomainImpl mMetaBossDomainImpl = null;
26: private BOPropertyDescriptor mParentDescriptor = null;
27: private STPropertyDescriptor mDetails = null;
28:
29: /* Instance creator */
30: public static BOPropertyDescriptor createInstanceForExisting(
31: BOMetaBossDomainImpl pMetaBossDomainImpl,
32: BOPropertyDescriptor pParentDescriptor,
33: STPropertyDescriptor pDetails) throws BOException {
34: BOPropertyDescriptorImpl lImpl = new BOPropertyDescriptorImpl();
35: lImpl.mMetaBossDomainImpl = pMetaBossDomainImpl;
36: lImpl.mParentDescriptor = pParentDescriptor;
37: lImpl.mDetails = pDetails;
38: lImpl.setupForExisting();
39: return lImpl;
40: }
41:
42: /* Private constructor restricts instance creation from outside */
43: private BOPropertyDescriptorImpl() throws BOException {
44: }
45:
46: /* Retrieves the parent property descriptior or null if this is a top level property. */
47: public BOPropertyDescriptor getParentPropertyDescriptor()
48: throws BOException {
49: return mParentDescriptor;
50: }
51:
52: /* Retrieves the name of the property this descriptor is about. */
53: public String getPropertyName() throws BOException {
54: return mDetails.Name;
55: }
56:
57: /* Returns description of the property */
58: public String getPropertyDescription() throws BOException {
59: return mDetails.Description;
60: }
61:
62: /* Returns true if this descriptor describes an array property */
63: public boolean isArrayProperty() throws BOException {
64: return mDetails.IsArray;
65: }
66:
67: /* Returns true if this descriptor describes a property, which is available at run time as a resource */
68: public boolean isPropertyAvailableAsResource() throws BOException {
69: return mDetails.IsAvailableAsResource;
70: }
71:
72: /* Retrieves property descriptors */
73: public BOPropertyDescriptorList getSubPropertiesDescriptors()
74: throws BOException {
75: return BOPropertyDescriptorListImpl
76: .createInstanceForExisting(mMetaBossDomainImpl, this,
77: mDetails.PropertyDescriptors);
78: }
79: }
|