View Javadoc
1   // license-header java merge-point
2   //
3   // Attention: generated code (by MetafacadeLogic.vsl) - do not modify!
4   //
5   package org.andromda.metafacades.uml14;
6   
7   import java.util.Collection;
8   import org.andromda.core.metafacade.MetafacadeBase;
9   import org.andromda.core.metafacade.ModelValidationMessage;
10  import org.andromda.metafacades.uml.AttributeFacade;
11  import org.andromda.metafacades.uml.ClassifierFacade;
12  import org.andromda.metafacades.uml.EnumerationFacade;
13  import org.andromda.translation.ocl.validation.OCLCollections;
14  import org.andromda.translation.ocl.validation.OCLExpressions;
15  import org.andromda.translation.ocl.validation.OCLIntrospector;
16  import org.andromda.translation.ocl.validation.OCLResultEnsurer;
17  import org.apache.log4j.Logger;
18  import org.omg.uml.foundation.core.Attribute;
19  
20  /**
21   * Represents an attribute on a classifier. UML2 maps both Attributes and AssociationEnds to
22   * Property. A property is a structural feature of a classifier that characterizes instances of the
23   * classifier. A property related by ownedAttribute to a classifier (other than an association)
24   * represents an attribute and might also represent an association end. It relates an instance of
25   * the class to a value or set of values of the type of the attribute. A property represents a set
26   * of instances that are owned by a containing classifier instance. Property represents a declared
27   * state of one or more instances in terms of a named relationship to a value or values. When a
28   * property is an attribute of a classifier, the value or values are related to the instance of the
29   * classifier by being held in slots of the instance. The range of valid values represented by the
30   * property can be controlled by setting the property's type.
31   * MetafacadeLogic for AttributeFacade
32   *
33   * @see AttributeFacade
34   */
35  public abstract class AttributeFacadeLogic
36      extends ModelElementFacadeLogicImpl
37      implements AttributeFacade
38  {
39      /**
40       * The underlying UML object
41       * @see Attribute
42       */
43      protected Attribute metaObject;
44  
45      /** Create Metafacade implementation instance using the MetafacadeFactory from the context
46       * @param metaObjectIn
47       * @param context
48       */
49      protected AttributeFacadeLogic(Attribute metaObjectIn, String context)
50      {
51          super(metaObjectIn, getContext(context));
52          this.metaObject = metaObjectIn;
53      }
54  
55      /**
56       * The logger instance.
57       */
58      private static final Logger logger = Logger.getLogger(AttributeFacadeLogic.class);
59  
60      /**
61       * Gets the context for this metafacade logic instance.
62       * @param context String. Set to AttributeFacade if null
63       * @return context String
64       */
65      private static String getContext(String context)
66      {
67          if (context == null)
68          {
69              context = "org.andromda.metafacades.uml.AttributeFacade";
70          }
71          return context;
72      }
73  
74      /** Reset context only for non-root metafacades
75       * @param context
76       */
77      @Override
78      public void resetMetafacadeContext(String context)
79      {
80          if (!this.contextRoot) // reset context only for non-root metafacades
81          {
82              context = getContext(context);  // to have same value as in original constructor call
83              setMetafacadeContext (context);
84          }
85      }
86  
87      /**
88       * @return boolean true always
89       * @see AttributeFacade
90       */
91      public boolean isAttributeFacadeMetaType()
92      {
93          return true;
94      }
95  
96      // --------------- attributes ---------------------
97  
98     /**
99      * @see AttributeFacade#getGetterName()
100     * @return String
101     */
102     protected abstract String handleGetGetterName();
103 
104     private String __getterName1a;
105     private boolean __getterName1aSet = false;
106 
107     /**
108      * The name of the accessor operation that would retrieve this attribute's value.
109      * @return (String)handleGetGetterName()
110      */
111     public final String getGetterName()
112     {
113         String getterName1a = this.__getterName1a;
114         if (!this.__getterName1aSet)
115         {
116             // getterName has no pre constraints
117             getterName1a = handleGetGetterName();
118             // getterName has no post constraints
119             this.__getterName1a = getterName1a;
120             if (isMetafacadePropertyCachingEnabled())
121             {
122                 this.__getterName1aSet = true;
123             }
124         }
125         return getterName1a;
126     }
127 
128    /**
129     * @see AttributeFacade#getSetterName()
130     * @return String
131     */
132     protected abstract String handleGetSetterName();
133 
134     private String __setterName2a;
135     private boolean __setterName2aSet = false;
136 
137     /**
138      * The name of the mutator operation that would retrieve this attribute's value.
139      * @return (String)handleGetSetterName()
140      */
141     public final String getSetterName()
142     {
143         String setterName2a = this.__setterName2a;
144         if (!this.__setterName2aSet)
145         {
146             // setterName has no pre constraints
147             setterName2a = handleGetSetterName();
148             // setterName has no post constraints
149             this.__setterName2a = setterName2a;
150             if (isMetafacadePropertyCachingEnabled())
151             {
152                 this.__setterName2aSet = true;
153             }
154         }
155         return setterName2a;
156     }
157 
158    /**
159     * @see AttributeFacade#isReadOnly()
160     * @return boolean
161     */
162     protected abstract boolean handleIsReadOnly();
163 
164     private boolean __readOnly3a;
165     private boolean __readOnly3aSet = false;
166 
167     /**
168      * Whether or not this attribute can be modified.
169      * @return (boolean)handleIsReadOnly()
170      */
171     public final boolean isReadOnly()
172     {
173         boolean readOnly3a = this.__readOnly3a;
174         if (!this.__readOnly3aSet)
175         {
176             // readOnly has no pre constraints
177             readOnly3a = handleIsReadOnly();
178             // readOnly has no post constraints
179             this.__readOnly3a = readOnly3a;
180             if (isMetafacadePropertyCachingEnabled())
181             {
182                 this.__readOnly3aSet = true;
183             }
184         }
185         return readOnly3a;
186     }
187 
188    /**
189     * @see AttributeFacade#getDefaultValue()
190     * @return String
191     */
192     protected abstract String handleGetDefaultValue();
193 
194     private String __defaultValue4a;
195     private boolean __defaultValue4aSet = false;
196 
197     /**
198      * The default value of the attribute.  This is the value given if no value is defined.
199      * @return (String)handleGetDefaultValue()
200      */
201     public final String getDefaultValue()
202     {
203         String defaultValue4a = this.__defaultValue4a;
204         if (!this.__defaultValue4aSet)
205         {
206             // defaultValue has no pre constraints
207             defaultValue4a = handleGetDefaultValue();
208             // defaultValue has no post constraints
209             this.__defaultValue4a = defaultValue4a;
210             if (isMetafacadePropertyCachingEnabled())
211             {
212                 this.__defaultValue4aSet = true;
213             }
214         }
215         return defaultValue4a;
216     }
217 
218    /**
219     * @see AttributeFacade#isStatic()
220     * @return boolean
221     */
222     protected abstract boolean handleIsStatic();
223 
224     private boolean __static5a;
225     private boolean __static5aSet = false;
226 
227     /**
228      * Indicates if this attribute is 'static', meaning it has a classifier scope.
229      * @return (boolean)handleIsStatic()
230      */
231     public final boolean isStatic()
232     {
233         boolean static5a = this.__static5a;
234         if (!this.__static5aSet)
235         {
236             // static has no pre constraints
237             static5a = handleIsStatic();
238             // static has no post constraints
239             this.__static5a = static5a;
240             if (isMetafacadePropertyCachingEnabled())
241             {
242                 this.__static5aSet = true;
243             }
244         }
245         return static5a;
246     }
247 
248    /**
249     * @see AttributeFacade#isRequired()
250     * @return boolean
251     */
252     protected abstract boolean handleIsRequired();
253 
254     private boolean __required6a;
255     private boolean __required6aSet = false;
256 
257     /**
258      * Whether or not the multiplicity of this attribute is 1.
259      * @return (boolean)handleIsRequired()
260      */
261     public final boolean isRequired()
262     {
263         boolean required6a = this.__required6a;
264         if (!this.__required6aSet)
265         {
266             // required has no pre constraints
267             required6a = handleIsRequired();
268             // required has no post constraints
269             this.__required6a = required6a;
270             if (isMetafacadePropertyCachingEnabled())
271             {
272                 this.__required6aSet = true;
273             }
274         }
275         return required6a;
276     }
277 
278    /**
279     * @see AttributeFacade#isMany()
280     * @return boolean
281     */
282     protected abstract boolean handleIsMany();
283 
284     private boolean __many7a;
285     private boolean __many7aSet = false;
286 
287     /**
288      * Whether or not this attribute has a multiplicity greater than 1.
289      * @return (boolean)handleIsMany()
290      */
291     public final boolean isMany()
292     {
293         boolean many7a = this.__many7a;
294         if (!this.__many7aSet)
295         {
296             // many has no pre constraints
297             many7a = handleIsMany();
298             // many has no post constraints
299             this.__many7a = many7a;
300             if (isMetafacadePropertyCachingEnabled())
301             {
302                 this.__many7aSet = true;
303             }
304         }
305         return many7a;
306     }
307 
308    /**
309     * @see AttributeFacade#isChangeable()
310     * @return boolean
311     */
312     protected abstract boolean handleIsChangeable();
313 
314     private boolean __changeable8a;
315     private boolean __changeable8aSet = false;
316 
317     /**
318      * True if this attribute can be modified.
319      * @return (boolean)handleIsChangeable()
320      */
321     public final boolean isChangeable()
322     {
323         boolean changeable8a = this.__changeable8a;
324         if (!this.__changeable8aSet)
325         {
326             // changeable has no pre constraints
327             changeable8a = handleIsChangeable();
328             // changeable has no post constraints
329             this.__changeable8a = changeable8a;
330             if (isMetafacadePropertyCachingEnabled())
331             {
332                 this.__changeable8aSet = true;
333             }
334         }
335         return changeable8a;
336     }
337 
338    /**
339     * @see AttributeFacade#isAddOnly()
340     * @return boolean
341     */
342     protected abstract boolean handleIsAddOnly();
343 
344     private boolean __addOnly9a;
345     private boolean __addOnly9aSet = false;
346 
347     /**
348      * True if this attribute can only be set.
349      * @return (boolean)handleIsAddOnly()
350      */
351     public final boolean isAddOnly()
352     {
353         boolean addOnly9a = this.__addOnly9a;
354         if (!this.__addOnly9aSet)
355         {
356             // addOnly has no pre constraints
357             addOnly9a = handleIsAddOnly();
358             // addOnly has no post constraints
359             this.__addOnly9a = addOnly9a;
360             if (isMetafacadePropertyCachingEnabled())
361             {
362                 this.__addOnly9aSet = true;
363             }
364         }
365         return addOnly9a;
366     }
367 
368    /**
369     * @see AttributeFacade#isEnumerationLiteral()
370     * @return boolean
371     */
372     protected abstract boolean handleIsEnumerationLiteral();
373 
374     private boolean __enumerationLiteral10a;
375     private boolean __enumerationLiteral10aSet = false;
376 
377     /**
378      * True if this attribute is owned by an enumeration.
379      * @return (boolean)handleIsEnumerationLiteral()
380      */
381     public final boolean isEnumerationLiteral()
382     {
383         boolean enumerationLiteral10a = this.__enumerationLiteral10a;
384         if (!this.__enumerationLiteral10aSet)
385         {
386             // enumerationLiteral has no pre constraints
387             enumerationLiteral10a = handleIsEnumerationLiteral();
388             // enumerationLiteral has no post constraints
389             this.__enumerationLiteral10a = enumerationLiteral10a;
390             if (isMetafacadePropertyCachingEnabled())
391             {
392                 this.__enumerationLiteral10aSet = true;
393             }
394         }
395         return enumerationLiteral10a;
396     }
397 
398    /**
399     * @see AttributeFacade#getEnumerationValue()
400     * @return String
401     */
402     protected abstract String handleGetEnumerationValue();
403 
404     private String __enumerationValue11a;
405     private boolean __enumerationValue11aSet = false;
406 
407     /**
408      * The value for this attribute if it is an enumeration literal, null otherwise. The default
409      * value is returned as a String if it has been specified, if it's not specified this
410      * attribute's name is assumed.
411      * @return (String)handleGetEnumerationValue()
412      */
413     public final String getEnumerationValue()
414     {
415         String enumerationValue11a = this.__enumerationValue11a;
416         if (!this.__enumerationValue11aSet)
417         {
418             // enumerationValue has no pre constraints
419             enumerationValue11a = handleGetEnumerationValue();
420             // enumerationValue has no post constraints
421             this.__enumerationValue11a = enumerationValue11a;
422             if (isMetafacadePropertyCachingEnabled())
423             {
424                 this.__enumerationValue11aSet = true;
425             }
426         }
427         return enumerationValue11a;
428     }
429 
430    /**
431     * @see AttributeFacade#getGetterSetterTypeName()
432     * @return String
433     */
434     protected abstract String handleGetGetterSetterTypeName();
435 
436     private String __getterSetterTypeName12a;
437     private boolean __getterSetterTypeName12aSet = false;
438 
439     /**
440      * The name of the type that is returned on the accessor and mutator operations,  determined in
441      * part by the multiplicity.
442      * @return (String)handleGetGetterSetterTypeName()
443      */
444     public final String getGetterSetterTypeName()
445     {
446         String getterSetterTypeName12a = this.__getterSetterTypeName12a;
447         if (!this.__getterSetterTypeName12aSet)
448         {
449             // getterSetterTypeName has no pre constraints
450             getterSetterTypeName12a = handleGetGetterSetterTypeName();
451             // getterSetterTypeName has no post constraints
452             this.__getterSetterTypeName12a = getterSetterTypeName12a;
453             if (isMetafacadePropertyCachingEnabled())
454             {
455                 this.__getterSetterTypeName12aSet = true;
456             }
457         }
458         return getterSetterTypeName12a;
459     }
460 
461    /**
462     * @see AttributeFacade#isOrdered()
463     * @return boolean
464     */
465     protected abstract boolean handleIsOrdered();
466 
467     private boolean __ordered13a;
468     private boolean __ordered13aSet = false;
469 
470     /**
471      * Indicates whether or not the attributes are ordered (if multiplicity is greater than 1).
472      * @return (boolean)handleIsOrdered()
473      */
474     public final boolean isOrdered()
475     {
476         boolean ordered13a = this.__ordered13a;
477         if (!this.__ordered13aSet)
478         {
479             // ordered has no pre constraints
480             ordered13a = handleIsOrdered();
481             // ordered has no post constraints
482             this.__ordered13a = ordered13a;
483             if (isMetafacadePropertyCachingEnabled())
484             {
485                 this.__ordered13aSet = true;
486             }
487         }
488         return ordered13a;
489     }
490 
491    /**
492     * @see AttributeFacade#isDefaultValuePresent()
493     * @return boolean
494     */
495     protected abstract boolean handleIsDefaultValuePresent();
496 
497     private boolean __defaultValuePresent14a;
498     private boolean __defaultValuePresent14aSet = false;
499 
500     /**
501      * Indicates if the default value is present.
502      * @return (boolean)handleIsDefaultValuePresent()
503      */
504     public final boolean isDefaultValuePresent()
505     {
506         boolean defaultValuePresent14a = this.__defaultValuePresent14a;
507         if (!this.__defaultValuePresent14aSet)
508         {
509             // defaultValuePresent has no pre constraints
510             defaultValuePresent14a = handleIsDefaultValuePresent();
511             // defaultValuePresent has no post constraints
512             this.__defaultValuePresent14a = defaultValuePresent14a;
513             if (isMetafacadePropertyCachingEnabled())
514             {
515                 this.__defaultValuePresent14aSet = true;
516             }
517         }
518         return defaultValuePresent14a;
519     }
520 
521    /**
522     * @see AttributeFacade#getUpper()
523     * @return int
524     */
525     protected abstract int handleGetUpper();
526 
527     private int __upper15a;
528     private boolean __upper15aSet = false;
529 
530     /**
531      * the upper value for the multiplicity (will be -1 for *)
532      * -only applicable for UML2
533      * @return (int)handleGetUpper()
534      */
535     public final int getUpper()
536     {
537         int upper15a = this.__upper15a;
538         if (!this.__upper15aSet)
539         {
540             // upper has no pre constraints
541             upper15a = handleGetUpper();
542             // upper has no post constraints
543             this.__upper15a = upper15a;
544             if (isMetafacadePropertyCachingEnabled())
545             {
546                 this.__upper15aSet = true;
547             }
548         }
549         return upper15a;
550     }
551 
552    /**
553     * @see AttributeFacade#getLower()
554     * @return int
555     */
556     protected abstract int handleGetLower();
557 
558     private int __lower16a;
559     private boolean __lower16aSet = false;
560 
561     /**
562      * the lower value for the multiplicity
563      * -only applicable for UML2
564      * @return (int)handleGetLower()
565      */
566     public final int getLower()
567     {
568         int lower16a = this.__lower16a;
569         if (!this.__lower16aSet)
570         {
571             // lower has no pre constraints
572             lower16a = handleGetLower();
573             // lower has no post constraints
574             this.__lower16a = lower16a;
575             if (isMetafacadePropertyCachingEnabled())
576             {
577                 this.__lower16aSet = true;
578             }
579         }
580         return lower16a;
581     }
582 
583    /**
584     * @see AttributeFacade#isEnumerationMember()
585     * @return boolean
586     */
587     protected abstract boolean handleIsEnumerationMember();
588 
589     private boolean __enumerationMember17a;
590     private boolean __enumerationMember17aSet = false;
591 
592     /**
593      * True if this attribute is owned by an enumeration but is defined as a member variable (NOT a
594      * literal).
595      * @return (boolean)handleIsEnumerationMember()
596      */
597     public final boolean isEnumerationMember()
598     {
599         boolean enumerationMember17a = this.__enumerationMember17a;
600         if (!this.__enumerationMember17aSet)
601         {
602             // enumerationMember has no pre constraints
603             enumerationMember17a = handleIsEnumerationMember();
604             // enumerationMember has no post constraints
605             this.__enumerationMember17a = enumerationMember17a;
606             if (isMetafacadePropertyCachingEnabled())
607             {
608                 this.__enumerationMember17aSet = true;
609             }
610         }
611         return enumerationMember17a;
612     }
613 
614    /**
615     * @see AttributeFacade#getEnumerationLiteralParameters()
616     * @return String
617     */
618     protected abstract String handleGetEnumerationLiteralParameters();
619 
620     private String __enumerationLiteralParameters18a;
621     private boolean __enumerationLiteralParameters18aSet = false;
622 
623     /**
624      * Returns the enumeration literal parameters defined by tagged value as a comma separated list.
625      * @return (String)handleGetEnumerationLiteralParameters()
626      */
627     public final String getEnumerationLiteralParameters()
628     {
629         String enumerationLiteralParameters18a = this.__enumerationLiteralParameters18a;
630         if (!this.__enumerationLiteralParameters18aSet)
631         {
632             // enumerationLiteralParameters has no pre constraints
633             enumerationLiteralParameters18a = handleGetEnumerationLiteralParameters();
634             // enumerationLiteralParameters has no post constraints
635             this.__enumerationLiteralParameters18a = enumerationLiteralParameters18a;
636             if (isMetafacadePropertyCachingEnabled())
637             {
638                 this.__enumerationLiteralParameters18aSet = true;
639             }
640         }
641         return enumerationLiteralParameters18a;
642     }
643 
644    /**
645     * @see AttributeFacade#isEnumerationLiteralParametersExist()
646     * @return boolean
647     */
648     protected abstract boolean handleIsEnumerationLiteralParametersExist();
649 
650     private boolean __enumerationLiteralParametersExist19a;
651     private boolean __enumerationLiteralParametersExist19aSet = false;
652 
653     /**
654      * Returns true if enumeration literal parameters exist (defined by tagged value) for the
655      * literal.
656      * @return (boolean)handleIsEnumerationLiteralParametersExist()
657      */
658     public final boolean isEnumerationLiteralParametersExist()
659     {
660         boolean enumerationLiteralParametersExist19a = this.__enumerationLiteralParametersExist19a;
661         if (!this.__enumerationLiteralParametersExist19aSet)
662         {
663             // enumerationLiteralParametersExist has no pre constraints
664             enumerationLiteralParametersExist19a = handleIsEnumerationLiteralParametersExist();
665             // enumerationLiteralParametersExist has no post constraints
666             this.__enumerationLiteralParametersExist19a = enumerationLiteralParametersExist19a;
667             if (isMetafacadePropertyCachingEnabled())
668             {
669                 this.__enumerationLiteralParametersExist19aSet = true;
670             }
671         }
672         return enumerationLiteralParametersExist19a;
673     }
674 
675    /**
676     * @see AttributeFacade#isUnique()
677     * @return boolean
678     */
679     protected abstract boolean handleIsUnique();
680 
681     private boolean __unique20a;
682     private boolean __unique20aSet = false;
683 
684     /**
685      * If the attribute is unique within the Collection type. UML2 only. UML14 always returns false.
686      * Unique+Ordered determines the implementation Collection type. Default=false.
687      * @return (boolean)handleIsUnique()
688      */
689     public final boolean isUnique()
690     {
691         boolean unique20a = this.__unique20a;
692         if (!this.__unique20aSet)
693         {
694             // unique has no pre constraints
695             unique20a = handleIsUnique();
696             // unique has no post constraints
697             this.__unique20a = unique20a;
698             if (isMetafacadePropertyCachingEnabled())
699             {
700                 this.__unique20aSet = true;
701             }
702         }
703         return unique20a;
704     }
705 
706    /**
707     * @see AttributeFacade#isLeaf()
708     * @return boolean
709     */
710     protected abstract boolean handleIsLeaf();
711 
712     private boolean __leaf21a;
713     private boolean __leaf21aSet = false;
714 
715     /**
716      * IsLeaf property in the operation. If true, operation is final, cannot be extended or
717      * implemented by a descendant.
718      * @return (boolean)handleIsLeaf()
719      */
720     public final boolean isLeaf()
721     {
722         boolean leaf21a = this.__leaf21a;
723         if (!this.__leaf21aSet)
724         {
725             // leaf has no pre constraints
726             leaf21a = handleIsLeaf();
727             // leaf has no post constraints
728             this.__leaf21a = leaf21a;
729             if (isMetafacadePropertyCachingEnabled())
730             {
731                 this.__leaf21aSet = true;
732             }
733         }
734         return leaf21a;
735     }
736 
737    /**
738     * @see AttributeFacade#isDerived()
739     * @return boolean
740     */
741     protected abstract boolean handleIsDerived();
742 
743     private boolean __derived22a;
744     private boolean __derived22aSet = false;
745 
746     /**
747      * If the attribute is derived (its value is computed). UML2 only. UML14 always returns false.
748      * Default=false.
749      * @return (boolean)handleIsDerived()
750      */
751     public final boolean isDerived()
752     {
753         boolean derived22a = this.__derived22a;
754         if (!this.__derived22aSet)
755         {
756             // derived has no pre constraints
757             derived22a = handleIsDerived();
758             // derived has no post constraints
759             this.__derived22a = derived22a;
760             if (isMetafacadePropertyCachingEnabled())
761             {
762                 this.__derived22aSet = true;
763             }
764         }
765         return derived22a;
766     }
767 
768     // ---------------- business methods ----------------------
769 
770     /**
771      * Method to be implemented in descendants
772      * Searches the given feature for the specified tag.
773      * If the follow boolean is set to true then the search will continue from the class attribute
774      * to the class itself and then up the class hierarchy.
775      * @param name
776      * @param follow
777      * @return Object
778      */
779     protected abstract Object handleFindTaggedValue(String name, boolean follow);
780 
781     /**
782      * Searches the given feature for the specified tag.
783      * If the follow boolean is set to true then the search will continue from the class attribute
784      * to the class itself and then up the class hierarchy.
785      * @param name String
786      * The name of the tagged value to find.
787      * @param follow boolean
788      * If true search should 'follow' the inheritance hierarchy, false otherwise.
789      * @return handleFindTaggedValue(name, follow)
790      */
791     public Object findTaggedValue(String name, boolean follow)
792     {
793         // findTaggedValue has no pre constraints
794         Object returnValue = handleFindTaggedValue(name, follow);
795         // findTaggedValue has no post constraints
796         return returnValue;
797     }
798 
799     // ------------- associations ------------------
800 
801     /**
802      * Represents an attribute on a classifier. UML2 maps both Attributes and AssociationEnds to
803      * Property.
804      * A property is a structural feature of a classifier that characterizes instances of the
805      * classifier. A
806      * property related by ownedAttribute to a classifier (other than an association) represents an
807      * attribute and might also represent an association end. It relates an instance of the class to
808      * a
809      * value or set of values of the type of the attribute. A property represents a set of instances
810      * that
811      * are owned by a containing classifier instance. Property represents a declared state of one or
812      * more
813      * instances in terms of a named relationship to a value or values. When a property is an
814      * attribute of
815      * a classifier, the value or values are related to the instance of the classifier by being held
816      * in
817      * slots of the instance. The range of valid values represented by the property can be
818      * controlled by
819      * setting the property's type.
820      * @return (ClassifierFacade)handleGetType()
821      */
822     public final ClassifierFacade getType()
823     {
824         ClassifierFacade getType1r = null;
825         // attributeFacade has no pre constraints
826         Object result = handleGetType();
827         MetafacadeBase shieldedResult = this.shieldedElement(result);
828         try
829         {
830             getType1r = (ClassifierFacade)shieldedResult;
831         }
832         catch (ClassCastException ex)
833         {
834             // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
835             AttributeFacadeLogic.logger.warn("incorrect metafacade cast for AttributeFacadeLogic.getType ClassifierFacade " + result + ": " + shieldedResult);
836         }
837         // attributeFacade has no post constraints
838         return getType1r;
839     }
840 
841     /**
842      * UML Specific type is transformed by shieldedElements to AndroMDA Metafacade type
843      * @return Object
844      */
845     protected abstract Object handleGetType();
846 
847     /**
848      * This enumeration's literals.
849      * @return (EnumerationFacade)handleGetEnumeration()
850      */
851     public final EnumerationFacade getEnumeration()
852     {
853         EnumerationFacade getEnumeration2r = null;
854         // literals has no pre constraints
855         Object result = handleGetEnumeration();
856         MetafacadeBase shieldedResult = this.shieldedElement(result);
857         try
858         {
859             getEnumeration2r = (EnumerationFacade)shieldedResult;
860         }
861         catch (ClassCastException ex)
862         {
863             // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
864             AttributeFacadeLogic.logger.warn("incorrect metafacade cast for AttributeFacadeLogic.getEnumeration EnumerationFacade " + result + ": " + shieldedResult);
865         }
866         // literals has no post constraints
867         return getEnumeration2r;
868     }
869 
870     /**
871      * UML Specific type is transformed by shieldedElements to AndroMDA Metafacade type
872      * @return Object
873      */
874     protected abstract Object handleGetEnumeration();
875 
876     /**
877      * Gets the attributes that belong to the classifier.
878      * @return (ClassifierFacade)handleGetOwner()
879      */
880     public final ClassifierFacade getOwner()
881     {
882         ClassifierFacade getOwner3r = null;
883         // attributes has no pre constraints
884         Object result = handleGetOwner();
885         MetafacadeBase shieldedResult = this.shieldedElement(result);
886         try
887         {
888             getOwner3r = (ClassifierFacade)shieldedResult;
889         }
890         catch (ClassCastException ex)
891         {
892             // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
893             AttributeFacadeLogic.logger.warn("incorrect metafacade cast for AttributeFacadeLogic.getOwner ClassifierFacade " + result + ": " + shieldedResult);
894         }
895         // attributes has no post constraints
896         return getOwner3r;
897     }
898 
899     /**
900      * UML Specific type is transformed by shieldedElements to AndroMDA Metafacade type
901      * @return Object
902      */
903     protected abstract Object handleGetOwner();
904 
905     /**
906      * <p><b>Constraint:</b> org::andromda::metafacades::uml::AttributeFacade::attribute needs a type</p>
907      * <p><b>Error:</b> Each attribute needs a type, you cannot leave the type unspecified.</p>
908      * <p><b>OCL:</b> context AttributeFacade inv: type.name->notEmpty()</p>
909      * <p><b>Constraint:</b> org::andromda::metafacades::uml::AttributeFacade::attribute must have a name</p>
910      * <p><b>Error:</b> Each attribute must have a non-empty name.</p>
911      * <p><b>OCL:</b> context AttributeFacade inv: name -> notEmpty()</p>
912      * <p><b>Constraint:</b> org::andromda::metafacades::uml::AttributeFacade::primitive attribute must be required</p>
913      * <p><b>Error:</b> Primitive attributes must have a multiplicity lower bound > 0 (must be required). Use a wrapped type, or change the multiplicity.</p>
914      * <p><b>OCL:</b> context AttributeFacade inv: type.primitive implies (lower > 0)</p>
915      * <p><b>Constraint:</b> org::andromda::metafacades::uml::AttributeFacade::primitive attribute cannot be used in Collection</p>
916      * <p><b>Error:</b> Primitive attributes cannot be used in Collections (multiplicity > 1). Use the wrapped type instead.</p>
917      * <p><b>OCL:</b> context AttributeFacade inv: type.primitive implies (many = false)</p>
918      * <p><b>Constraint:</b> org::andromda::metafacades::uml::AttributeFacade::wrapped primitive attribute should not be required</p>
919      * <p><b>Error:</b> Wrapped primitive attributes must have a multiplicity lower bound = 0 (must be optional). Use the unwrapped type, or change the multiplicity.</p>
920      * <p><b>OCL:</b> context AttributeFacade inv: type.wrappedPrimitive and many = false implies (lower = 0)</p>
921      * @param validationMessages Collection<ModelValidationMessage>
922      * @see ModelElementFacadeLogicImpl#validateInvariants(Collection validationMessages)
923      */
924     @Override
925     public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
926     {
927         super.validateInvariants(validationMessages);
928         try
929         {
930             final Object contextElement = this.THIS();
931             boolean constraintValid = OCLResultEnsurer.ensure(OCLCollections.notEmpty(OCLIntrospector.invoke(contextElement,"type.name")));
932             if (!constraintValid)
933             {
934                 validationMessages.add(
935                     new ModelValidationMessage(
936                         (MetafacadeBase)contextElement ,
937                         "org::andromda::metafacades::uml::AttributeFacade::attribute needs a type",
938                         "Each attribute needs a type, you cannot leave the type unspecified."));
939             }
940         }
941         catch (Throwable th)
942         {
943             Throwable cause = th.getCause();
944             int depth = 0; // Some throwables have infinite recursion
945             while (cause != null && depth < 7)
946             {
947                 th = cause;
948                 depth++;
949             }
950             logger.error("Error validating constraint 'org::andromda::metafacades::uml::AttributeFacade::attribute needs a type' ON "
951                 + this.THIS().toString() + ": " + th.getMessage(), th);
952         }
953         try
954         {
955             final Object contextElement = this.THIS();
956             boolean constraintValid = OCLResultEnsurer.ensure(OCLCollections.notEmpty(OCLIntrospector.invoke(contextElement,"name")));
957             if (!constraintValid)
958             {
959                 validationMessages.add(
960                     new ModelValidationMessage(
961                         (MetafacadeBase)contextElement ,
962                         "org::andromda::metafacades::uml::AttributeFacade::attribute must have a name",
963                         "Each attribute must have a non-empty name."));
964             }
965         }
966         catch (Throwable th)
967         {
968             Throwable cause = th.getCause();
969             int depth = 0; // Some throwables have infinite recursion
970             while (cause != null && depth < 7)
971             {
972                 th = cause;
973                 depth++;
974             }
975             logger.error("Error validating constraint 'org::andromda::metafacades::uml::AttributeFacade::attribute must have a name' ON "
976                 + this.THIS().toString() + ": " + th.getMessage(), th);
977         }
978         try
979         {
980             final Object contextElement = this.THIS();
981             boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"type.primitive"))).booleanValue()?(OCLExpressions.greater(OCLIntrospector.invoke(contextElement,"lower"),0)):true));
982             if (!constraintValid)
983             {
984                 validationMessages.add(
985                     new ModelValidationMessage(
986                         (MetafacadeBase)contextElement ,
987                         "org::andromda::metafacades::uml::AttributeFacade::primitive attribute must be required",
988                         "Primitive attributes must have a multiplicity lower bound > 0 (must be required). Use a wrapped type, or change the multiplicity."));
989             }
990         }
991         catch (Throwable th)
992         {
993             Throwable cause = th.getCause();
994             int depth = 0; // Some throwables have infinite recursion
995             while (cause != null && depth < 7)
996             {
997                 th = cause;
998                 depth++;
999             }
1000             logger.error("Error validating constraint 'org::andromda::metafacades::uml::AttributeFacade::primitive attribute must be required' ON "
1001                 + this.THIS().toString() + ": " + th.getMessage(), th);
1002         }
1003         try
1004         {
1005             final Object contextElement = this.THIS();
1006             boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"type.primitive"))).booleanValue()?(OCLExpressions.equal(OCLIntrospector.invoke(contextElement,"many"),false)):true));
1007             if (!constraintValid)
1008             {
1009                 validationMessages.add(
1010                     new ModelValidationMessage(
1011                         (MetafacadeBase)contextElement ,
1012                         "org::andromda::metafacades::uml::AttributeFacade::primitive attribute cannot be used in Collection",
1013                         "Primitive attributes cannot be used in Collections (multiplicity > 1). Use the wrapped type instead."));
1014             }
1015         }
1016         catch (Throwable th)
1017         {
1018             Throwable cause = th.getCause();
1019             int depth = 0; // Some throwables have infinite recursion
1020             while (cause != null && depth < 7)
1021             {
1022                 th = cause;
1023                 depth++;
1024             }
1025             logger.error("Error validating constraint 'org::andromda::metafacades::uml::AttributeFacade::primitive attribute cannot be used in Collection' ON "
1026                 + this.THIS().toString() + ": " + th.getMessage(), th);
1027         }
1028         try
1029         {
1030             final Object contextElement = this.THIS();
1031             boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"type.wrappedPrimitive"))).booleanValue()&&OCLExpressions.equal(OCLIntrospector.invoke(contextElement,"many"),false))).booleanValue()?(OCLExpressions.equal(OCLIntrospector.invoke(contextElement,"lower"),0)):true));
1032             if (!constraintValid)
1033             {
1034                 validationMessages.add(
1035                     new ModelValidationMessage(
1036                         (MetafacadeBase)contextElement ,
1037                         "org::andromda::metafacades::uml::AttributeFacade::wrapped primitive attribute should not be required",
1038                         "Wrapped primitive attributes must have a multiplicity lower bound = 0 (must be optional). Use the unwrapped type, or change the multiplicity."));
1039             }
1040         }
1041         catch (Throwable th)
1042         {
1043             Throwable cause = th.getCause();
1044             int depth = 0; // Some throwables have infinite recursion
1045             while (cause != null && depth < 7)
1046             {
1047                 th = cause;
1048                 depth++;
1049             }
1050             logger.error("Error validating constraint 'org::andromda::metafacades::uml::AttributeFacade::wrapped primitive attribute should not be required' ON "
1051                 + this.THIS().toString() + ": " + th.getMessage(), th);
1052         }
1053     }
1054 }