01: package org.andromda.cartridges.xmlschema.metafacades;
02:
03: /**
04: * MetafacadeLogic implementation for org.andromda.cartridges.xmlschema.metafacades.XSDAssociationEnd.
05: *
06: * @see org.andromda.cartridges.xmlschema.metafacades.XSDAssociationEnd
07: */
08: public class XSDAssociationEndLogicImpl extends XSDAssociationEndLogic {
09: // ---------------- constructor -------------------------------
10:
11: public XSDAssociationEndLogicImpl(Object metaObject, String context) {
12: super (metaObject, context);
13: }
14:
15: /**
16: * @see org.andromda.cartridges.xmlschema.metafacades.XSDAssociationEnd#getMaxOccurs()
17: */
18: protected java.lang.String handleGetMaxOccurs() {
19: String maxOccurs = null;
20: boolean isMany = this .isMany();
21: if (isMany) {
22: maxOccurs = "unbounded";
23: } else {
24: maxOccurs = "1";
25: }
26: return maxOccurs;
27: }
28:
29: /**
30: * @see org.andromda.cartridges.xmlschema.metafacades.XSDAssociationEnd#getMinOccurs()
31: */
32: protected java.lang.String handleGetMinOccurs() {
33: String minOccurs = null;
34: boolean isRequired = this .isRequired();
35: if (isRequired) {
36: minOccurs = "1";
37: } else {
38: minOccurs = "0";
39: }
40: return minOccurs;
41: }
42:
43: /**
44: * @see org.andromda.cartridges.xmlschema.metafacades.XSDAssociationEnd#isOwnerSchemaType()
45: */
46: protected boolean handleIsOwnerSchemaType() {
47: final Object owner = this .getType();
48: return owner instanceof XSDComplexType
49: || owner instanceof XSDEnumerationType;
50: }
51:
52: }
|