View Javadoc

1   package org.andromda.cartridges.xmlschema.metafacades;
2   
3   /**
4    * MetafacadeLogic implementation for org.andromda.cartridges.xmlschema.metafacades.XSDAssociationEnd.
5    *
6    * @see org.andromda.cartridges.xmlschema.metafacades.XSDAssociationEnd
7    */
8   public class XSDAssociationEndLogicImpl
9           extends XSDAssociationEndLogic
10  {
11      // ---------------- constructor -------------------------------
12  
13      public XSDAssociationEndLogicImpl(Object metaObject, String context)
14      {
15          super(metaObject, context);
16      }
17  
18      /**
19       * @see org.andromda.cartridges.xmlschema.metafacades.XSDAssociationEnd#getMaxOccurs()
20       */
21      protected java.lang.String handleGetMaxOccurs()
22      {
23          String maxOccurs = null;
24          boolean isMany = this.isMany();
25          if (isMany)
26          {
27              maxOccurs = "unbounded";
28          }
29          else
30          {
31              maxOccurs = "1";
32          }
33          return maxOccurs;
34      }
35  
36      /**
37       * @see org.andromda.cartridges.xmlschema.metafacades.XSDAssociationEnd#getMinOccurs()
38       */
39      protected java.lang.String handleGetMinOccurs()
40      {
41          String minOccurs = null;
42          boolean isRequired = this.isRequired();
43          if (isRequired)
44          {
45              minOccurs = "1";
46          }
47          else
48          {
49              minOccurs = "0";
50          }
51          return minOccurs;
52      }
53      
54      /**
55       * @see org.andromda.cartridges.xmlschema.metafacades.XSDAssociationEnd#isOwnerSchemaType()
56       */
57      protected boolean handleIsOwnerSchemaType()
58      {
59          final Object owner = this.getType();
60          return owner instanceof XSDComplexType || owner instanceof XSDEnumerationType;
61      }
62  
63  }