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.ClassifierFacade;
11  import org.andromda.metafacades.uml.EventFacade;
12  import org.andromda.metafacades.uml.OperationFacade;
13  import org.andromda.metafacades.uml.ParameterFacade;
14  import org.andromda.translation.ocl.validation.OCLCollections;
15  import org.andromda.translation.ocl.validation.OCLExpressions;
16  import org.andromda.translation.ocl.validation.OCLIntrospector;
17  import org.andromda.translation.ocl.validation.OCLResultEnsurer;
18  import org.apache.log4j.Logger;
19  import org.omg.uml.foundation.core.Parameter;
20  
21  /**
22   * Specification of an argument used to pass information into or out of an invocation of a
23   * behavioral feature. Parameters are allowed to be treated as connectable elements. Parameters have
24   * support for streaming, exceptions, and parameter sets.
25   * MetafacadeLogic for ParameterFacade
26   *
27   * @see ParameterFacade
28   */
29  public abstract class ParameterFacadeLogic
30      extends ModelElementFacadeLogicImpl
31      implements ParameterFacade
32  {
33      /**
34       * The underlying UML object
35       * @see Parameter
36       */
37      protected Parameter metaObject;
38  
39      /** Create Metafacade implementation instance using the MetafacadeFactory from the context
40       * @param metaObjectIn
41       * @param context
42       */
43      protected ParameterFacadeLogic(Parameter metaObjectIn, String context)
44      {
45          super(metaObjectIn, getContext(context));
46          this.metaObject = metaObjectIn;
47      }
48  
49      /**
50       * The logger instance.
51       */
52      private static final Logger logger = Logger.getLogger(ParameterFacadeLogic.class);
53  
54      /**
55       * Gets the context for this metafacade logic instance.
56       * @param context String. Set to ParameterFacade if null
57       * @return context String
58       */
59      private static String getContext(String context)
60      {
61          if (context == null)
62          {
63              context = "org.andromda.metafacades.uml.ParameterFacade";
64          }
65          return context;
66      }
67  
68      /** Reset context only for non-root metafacades
69       * @param context
70       */
71      @Override
72      public void resetMetafacadeContext(String context)
73      {
74          if (!this.contextRoot) // reset context only for non-root metafacades
75          {
76              context = getContext(context);  // to have same value as in original constructor call
77              setMetafacadeContext (context);
78          }
79      }
80  
81      /**
82       * @return boolean true always
83       * @see ParameterFacade
84       */
85      public boolean isParameterFacadeMetaType()
86      {
87          return true;
88      }
89  
90      // --------------- attributes ---------------------
91  
92     /**
93      * @see ParameterFacade#getDefaultValue()
94      * @return String
95      */
96      protected abstract String handleGetDefaultValue();
97  
98      private String __defaultValue1a;
99      private boolean __defaultValue1aSet = false;
100 
101     /**
102      * TODO: Model Documentation for ParameterFacade.defaultValue
103      * @return (String)handleGetDefaultValue()
104      */
105     public final String getDefaultValue()
106     {
107         String defaultValue1a = this.__defaultValue1a;
108         if (!this.__defaultValue1aSet)
109         {
110             // defaultValue has no pre constraints
111             defaultValue1a = handleGetDefaultValue();
112             // defaultValue has no post constraints
113             this.__defaultValue1a = defaultValue1a;
114             if (isMetafacadePropertyCachingEnabled())
115             {
116                 this.__defaultValue1aSet = true;
117             }
118         }
119         return defaultValue1a;
120     }
121 
122    /**
123     * @see ParameterFacade#isDefaultValuePresent()
124     * @return boolean
125     */
126     protected abstract boolean handleIsDefaultValuePresent();
127 
128     private boolean __defaultValuePresent2a;
129     private boolean __defaultValuePresent2aSet = false;
130 
131     /**
132      * Indicates if the default value is present.
133      * @return (boolean)handleIsDefaultValuePresent()
134      */
135     public final boolean isDefaultValuePresent()
136     {
137         boolean defaultValuePresent2a = this.__defaultValuePresent2a;
138         if (!this.__defaultValuePresent2aSet)
139         {
140             // defaultValuePresent has no pre constraints
141             defaultValuePresent2a = handleIsDefaultValuePresent();
142             // defaultValuePresent has no post constraints
143             this.__defaultValuePresent2a = defaultValuePresent2a;
144             if (isMetafacadePropertyCachingEnabled())
145             {
146                 this.__defaultValuePresent2aSet = true;
147             }
148         }
149         return defaultValuePresent2a;
150     }
151 
152    /**
153     * @see ParameterFacade#getGetterName()
154     * @return String
155     */
156     protected abstract String handleGetGetterName();
157 
158     private String __getterName3a;
159     private boolean __getterName3aSet = false;
160 
161     /**
162      * The name to use for accessors getting this parameter from a bean.
163      * @return (String)handleGetGetterName()
164      */
165     public final String getGetterName()
166     {
167         String getterName3a = this.__getterName3a;
168         if (!this.__getterName3aSet)
169         {
170             // getterName has no pre constraints
171             getterName3a = handleGetGetterName();
172             // getterName has no post constraints
173             this.__getterName3a = getterName3a;
174             if (isMetafacadePropertyCachingEnabled())
175             {
176                 this.__getterName3aSet = true;
177             }
178         }
179         return getterName3a;
180     }
181 
182    /**
183     * @see ParameterFacade#getGetterSetterTypeName()
184     * @return String
185     */
186     protected abstract String handleGetGetterSetterTypeName();
187 
188     private String __getterSetterTypeName4a;
189     private boolean __getterSetterTypeName4aSet = false;
190 
191     /**
192      * Fully Qualified TypeName, determined in part by multiplicity (for UML2). For UML14, same as
193      * getterName.
194      * @return (String)handleGetGetterSetterTypeName()
195      */
196     public final String getGetterSetterTypeName()
197     {
198         String getterSetterTypeName4a = this.__getterSetterTypeName4a;
199         if (!this.__getterSetterTypeName4aSet)
200         {
201             // getterSetterTypeName has no pre constraints
202             getterSetterTypeName4a = handleGetGetterSetterTypeName();
203             // getterSetterTypeName has no post constraints
204             this.__getterSetterTypeName4a = getterSetterTypeName4a;
205             if (isMetafacadePropertyCachingEnabled())
206             {
207                 this.__getterSetterTypeName4aSet = true;
208             }
209         }
210         return getterSetterTypeName4a;
211     }
212 
213    /**
214     * @see ParameterFacade#getGetterSetterTypeNameImpl()
215     * @return String
216     */
217     protected abstract String handleGetGetterSetterTypeNameImpl();
218 
219     private String __getterSetterTypeNameImpl5a;
220     private boolean __getterSetterTypeNameImpl5aSet = false;
221 
222     /**
223      * Fully Qualified implementation class of TypeName, determined in part by multiplicity (for
224      * UML2). If upper multiplicity =1, same as getterSetterTypeName.
225      * @return (String)handleGetGetterSetterTypeNameImpl()
226      */
227     public final String getGetterSetterTypeNameImpl()
228     {
229         String getterSetterTypeNameImpl5a = this.__getterSetterTypeNameImpl5a;
230         if (!this.__getterSetterTypeNameImpl5aSet)
231         {
232             // getterSetterTypeNameImpl has no pre constraints
233             getterSetterTypeNameImpl5a = handleGetGetterSetterTypeNameImpl();
234             // getterSetterTypeNameImpl has no post constraints
235             this.__getterSetterTypeNameImpl5a = getterSetterTypeNameImpl5a;
236             if (isMetafacadePropertyCachingEnabled())
237             {
238                 this.__getterSetterTypeNameImpl5aSet = true;
239             }
240         }
241         return getterSetterTypeNameImpl5a;
242     }
243 
244    /**
245     * @see ParameterFacade#isRequired()
246     * @return boolean
247     */
248     protected abstract boolean handleIsRequired();
249 
250     private boolean __required6a;
251     private boolean __required6aSet = false;
252 
253     /**
254      * Whether or not this parameter is considered required (i.e must a non-empty value).
255      * @return (boolean)handleIsRequired()
256      */
257     public final boolean isRequired()
258     {
259         boolean required6a = this.__required6a;
260         if (!this.__required6aSet)
261         {
262             // required has no pre constraints
263             required6a = handleIsRequired();
264             // required has no post constraints
265             this.__required6a = required6a;
266             if (isMetafacadePropertyCachingEnabled())
267             {
268                 this.__required6aSet = true;
269             }
270         }
271         return required6a;
272     }
273 
274    /**
275     * @see ParameterFacade#isReturn()
276     * @return boolean
277     */
278     protected abstract boolean handleIsReturn();
279 
280     private boolean __return7a;
281     private boolean __return7aSet = false;
282 
283     /**
284      * Whether or not this parameter represents a return parameter.
285      * @return (boolean)handleIsReturn()
286      */
287     public final boolean isReturn()
288     {
289         boolean return7a = this.__return7a;
290         if (!this.__return7aSet)
291         {
292             // return has no pre constraints
293             return7a = handleIsReturn();
294             // return has no post constraints
295             this.__return7a = return7a;
296             if (isMetafacadePropertyCachingEnabled())
297             {
298                 this.__return7aSet = true;
299             }
300         }
301         return return7a;
302     }
303 
304    /**
305     * @see ParameterFacade#getSetterName()
306     * @return String
307     */
308     protected abstract String handleGetSetterName();
309 
310     private String __setterName8a;
311     private boolean __setterName8aSet = false;
312 
313     /**
314      * The name to use for accessors getting this parameter in a bean.
315      * @return (String)handleGetSetterName()
316      */
317     public final String getSetterName()
318     {
319         String setterName8a = this.__setterName8a;
320         if (!this.__setterName8aSet)
321         {
322             // setterName has no pre constraints
323             setterName8a = handleGetSetterName();
324             // setterName has no post constraints
325             this.__setterName8a = setterName8a;
326             if (isMetafacadePropertyCachingEnabled())
327             {
328                 this.__setterName8aSet = true;
329             }
330         }
331         return setterName8a;
332     }
333 
334    /**
335     * @see ParameterFacade#isReadable()
336     * @return boolean
337     */
338     protected abstract boolean handleIsReadable();
339 
340     private boolean __readable9a;
341     private boolean __readable9aSet = false;
342 
343     /**
344      * True if this parameter is readable, aka an in-parameter, or this feature is unspecified.
345      * @return (boolean)handleIsReadable()
346      */
347     public final boolean isReadable()
348     {
349         boolean readable9a = this.__readable9a;
350         if (!this.__readable9aSet)
351         {
352             // readable has no pre constraints
353             readable9a = handleIsReadable();
354             // readable has no post constraints
355             this.__readable9a = readable9a;
356             if (isMetafacadePropertyCachingEnabled())
357             {
358                 this.__readable9aSet = true;
359             }
360         }
361         return readable9a;
362     }
363 
364    /**
365     * @see ParameterFacade#isWritable()
366     * @return boolean
367     */
368     protected abstract boolean handleIsWritable();
369 
370     private boolean __writable10a;
371     private boolean __writable10aSet = false;
372 
373     /**
374      * True if this parameter is writable, aka an out-parameter, or this feature is unspecified.
375      * @return (boolean)handleIsWritable()
376      */
377     public final boolean isWritable()
378     {
379         boolean writable10a = this.__writable10a;
380         if (!this.__writable10aSet)
381         {
382             // writable has no pre constraints
383             writable10a = handleIsWritable();
384             // writable has no post constraints
385             this.__writable10a = writable10a;
386             if (isMetafacadePropertyCachingEnabled())
387             {
388                 this.__writable10aSet = true;
389             }
390         }
391         return writable10a;
392     }
393 
394    /**
395     * @see ParameterFacade#isInParameter()
396     * @return boolean
397     */
398     protected abstract boolean handleIsInParameter();
399 
400     private boolean __inParameter11a;
401     private boolean __inParameter11aSet = false;
402 
403     /**
404      * True if this parameter is an 'in' parameter.
405      * @return (boolean)handleIsInParameter()
406      */
407     public final boolean isInParameter()
408     {
409         boolean inParameter11a = this.__inParameter11a;
410         if (!this.__inParameter11aSet)
411         {
412             // inParameter has no pre constraints
413             inParameter11a = handleIsInParameter();
414             // inParameter has no post constraints
415             this.__inParameter11a = inParameter11a;
416             if (isMetafacadePropertyCachingEnabled())
417             {
418                 this.__inParameter11aSet = true;
419             }
420         }
421         return inParameter11a;
422     }
423 
424    /**
425     * @see ParameterFacade#isOutParameter()
426     * @return boolean
427     */
428     protected abstract boolean handleIsOutParameter();
429 
430     private boolean __outParameter12a;
431     private boolean __outParameter12aSet = false;
432 
433     /**
434      * True if this parameter is an 'out' parameter.
435      * @return (boolean)handleIsOutParameter()
436      */
437     public final boolean isOutParameter()
438     {
439         boolean outParameter12a = this.__outParameter12a;
440         if (!this.__outParameter12aSet)
441         {
442             // outParameter has no pre constraints
443             outParameter12a = handleIsOutParameter();
444             // outParameter has no post constraints
445             this.__outParameter12a = outParameter12a;
446             if (isMetafacadePropertyCachingEnabled())
447             {
448                 this.__outParameter12aSet = true;
449             }
450         }
451         return outParameter12a;
452     }
453 
454    /**
455     * @see ParameterFacade#isInoutParameter()
456     * @return boolean
457     */
458     protected abstract boolean handleIsInoutParameter();
459 
460     private boolean __inoutParameter13a;
461     private boolean __inoutParameter13aSet = false;
462 
463     /**
464      * True if this parameter is an inout parameter.
465      * @return (boolean)handleIsInoutParameter()
466      */
467     public final boolean isInoutParameter()
468     {
469         boolean inoutParameter13a = this.__inoutParameter13a;
470         if (!this.__inoutParameter13aSet)
471         {
472             // inoutParameter has no pre constraints
473             inoutParameter13a = handleIsInoutParameter();
474             // inoutParameter has no post constraints
475             this.__inoutParameter13a = inoutParameter13a;
476             if (isMetafacadePropertyCachingEnabled())
477             {
478                 this.__inoutParameter13aSet = true;
479             }
480         }
481         return inoutParameter13a;
482     }
483 
484    /**
485     * @see ParameterFacade#getUpper()
486     * @return int
487     */
488     protected abstract int handleGetUpper();
489 
490     private int __upper14a;
491     private boolean __upper14aSet = false;
492 
493     /**
494      * the upper value of the multiplicity (will be -1 for *)
495      * -only applicable for UML2
496      * @return (int)handleGetUpper()
497      */
498     public final int getUpper()
499     {
500         int upper14a = this.__upper14a;
501         if (!this.__upper14aSet)
502         {
503             // upper has no pre constraints
504             upper14a = handleGetUpper();
505             // upper has no post constraints
506             this.__upper14a = upper14a;
507             if (isMetafacadePropertyCachingEnabled())
508             {
509                 this.__upper14aSet = true;
510             }
511         }
512         return upper14a;
513     }
514 
515    /**
516     * @see ParameterFacade#getLower()
517     * @return int
518     */
519     protected abstract int handleGetLower();
520 
521     private int __lower15a;
522     private boolean __lower15aSet = false;
523 
524     /**
525      * the lower value for the multiplicity
526      * -only applicable for UML2
527      * @return (int)handleGetLower()
528      */
529     public final int getLower()
530     {
531         int lower15a = this.__lower15a;
532         if (!this.__lower15aSet)
533         {
534             // lower has no pre constraints
535             lower15a = handleGetLower();
536             // lower has no post constraints
537             this.__lower15a = lower15a;
538             if (isMetafacadePropertyCachingEnabled())
539             {
540                 this.__lower15aSet = true;
541             }
542         }
543         return lower15a;
544     }
545 
546    /**
547     * @see ParameterFacade#isUnique()
548     * @return boolean
549     */
550     protected abstract boolean handleIsUnique();
551 
552     private boolean __unique16a;
553     private boolean __unique16aSet = false;
554 
555     /**
556      * If Parameter type isMany (UML2), is the parameter unique within the Collection. Unique+Sorted
557      * determines pareter implementation type. For UML14, always false.
558      * @return (boolean)handleIsUnique()
559      */
560     public final boolean isUnique()
561     {
562         boolean unique16a = this.__unique16a;
563         if (!this.__unique16aSet)
564         {
565             // unique has no pre constraints
566             unique16a = handleIsUnique();
567             // unique has no post constraints
568             this.__unique16a = unique16a;
569             if (isMetafacadePropertyCachingEnabled())
570             {
571                 this.__unique16aSet = true;
572             }
573         }
574         return unique16a;
575     }
576 
577    /**
578     * @see ParameterFacade#isOrdered()
579     * @return boolean
580     */
581     protected abstract boolean handleIsOrdered();
582 
583     private boolean __ordered17a;
584     private boolean __ordered17aSet = false;
585 
586     /**
587      * UML2 Only: Is parameter ordered within the Collection type. Ordered+Unique determines the
588      * implementation Collection Type. For UML14, always false.
589      * @return (boolean)handleIsOrdered()
590      */
591     public final boolean isOrdered()
592     {
593         boolean ordered17a = this.__ordered17a;
594         if (!this.__ordered17aSet)
595         {
596             // ordered has no pre constraints
597             ordered17a = handleIsOrdered();
598             // ordered has no post constraints
599             this.__ordered17a = ordered17a;
600             if (isMetafacadePropertyCachingEnabled())
601             {
602                 this.__ordered17aSet = true;
603             }
604         }
605         return ordered17a;
606     }
607 
608    /**
609     * @see ParameterFacade#isMany()
610     * @return boolean
611     */
612     protected abstract boolean handleIsMany();
613 
614     private boolean __many18a;
615     private boolean __many18aSet = false;
616 
617     /**
618      * If upper>1 or upper==unlimited. Only applies to UML2. For UML14, always false.
619      * @return (boolean)handleIsMany()
620      */
621     public final boolean isMany()
622     {
623         boolean many18a = this.__many18a;
624         if (!this.__many18aSet)
625         {
626             // many has no pre constraints
627             many18a = handleIsMany();
628             // many has no post constraints
629             this.__many18a = many18a;
630             if (isMetafacadePropertyCachingEnabled())
631             {
632                 this.__many18aSet = true;
633             }
634         }
635         return many18a;
636     }
637 
638    /**
639     * @see ParameterFacade#isException()
640     * @return boolean
641     */
642     protected abstract boolean handleIsException();
643 
644     private boolean __exception19a;
645     private boolean __exception19aSet = false;
646 
647     /**
648      * UML2: Returns the value of the 'Is Exception' attribute. The default value is "false". Tells
649      * whether an output parameter may emit a value to the exclusion of the other outputs.
650      * @return (boolean)handleIsException()
651      */
652     public final boolean isException()
653     {
654         boolean exception19a = this.__exception19a;
655         if (!this.__exception19aSet)
656         {
657             // exception has no pre constraints
658             exception19a = handleIsException();
659             // exception has no post constraints
660             this.__exception19a = exception19a;
661             if (isMetafacadePropertyCachingEnabled())
662             {
663                 this.__exception19aSet = true;
664             }
665         }
666         return exception19a;
667     }
668 
669    /**
670     * @see ParameterFacade#getEffect()
671     * @return String
672     */
673     protected abstract String handleGetEffect();
674 
675     private String __effect20a;
676     private boolean __effect20aSet = false;
677 
678     /**
679      * UML2: A representation of the literals of the enumeration 'Parameter Effect Kind': CREATE,
680      * READ, UPDATE, DELETE. The datatype ParameterEffectKind is an enumeration that indicates the
681      * effect of a behavior on values passed in or out of its parameters.
682      * @return (String)handleGetEffect()
683      */
684     public final String getEffect()
685     {
686         String effect20a = this.__effect20a;
687         if (!this.__effect20aSet)
688         {
689             // effect has no pre constraints
690             effect20a = handleGetEffect();
691             // effect has no post constraints
692             this.__effect20a = effect20a;
693             if (isMetafacadePropertyCachingEnabled())
694             {
695                 this.__effect20aSet = true;
696             }
697         }
698         return effect20a;
699     }
700 
701     // ------------- associations ------------------
702 
703     /**
704      * Specification of an argument used to pass information into or out of an invocation of a
705      * behavioral
706      * feature. Parameters are allowed to be treated as connectable elements. Parameters have
707      * support for
708      * streaming, exceptions, and parameter sets.
709      * @return (ClassifierFacade)handleGetType()
710      */
711     public final ClassifierFacade getType()
712     {
713         ClassifierFacade getType1r = null;
714         // parameterFacade has no pre constraints
715         Object result = handleGetType();
716         MetafacadeBase shieldedResult = this.shieldedElement(result);
717         try
718         {
719             getType1r = (ClassifierFacade)shieldedResult;
720         }
721         catch (ClassCastException ex)
722         {
723             // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
724             ParameterFacadeLogic.logger.warn("incorrect metafacade cast for ParameterFacadeLogic.getType ClassifierFacade " + result + ": " + shieldedResult);
725         }
726         // parameterFacade has no post constraints
727         return getType1r;
728     }
729 
730     /**
731      * UML Specific type is transformed by shieldedElements to AndroMDA Metafacade type
732      * @return Object
733      */
734     protected abstract Object handleGetType();
735 
736     /**
737      * The parameters to this event.
738      * @return (EventFacade)handleGetEvent()
739      */
740     public final EventFacade getEvent()
741     {
742         EventFacade getEvent2r = null;
743         // parameters has no pre constraints
744         Object result = handleGetEvent();
745         MetafacadeBase shieldedResult = this.shieldedElement(result);
746         try
747         {
748             getEvent2r = (EventFacade)shieldedResult;
749         }
750         catch (ClassCastException ex)
751         {
752             // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
753             ParameterFacadeLogic.logger.warn("incorrect metafacade cast for ParameterFacadeLogic.getEvent EventFacade " + result + ": " + shieldedResult);
754         }
755         // parameters has no post constraints
756         return getEvent2r;
757     }
758 
759     /**
760      * UML Specific type is transformed by shieldedElements to AndroMDA Metafacade type
761      * @return Object
762      */
763     protected abstract Object handleGetEvent();
764 
765     /**
766      * Return all parameters for the operation, including the return parameter.
767      * @return (OperationFacade)handleGetOperation()
768      */
769     public final OperationFacade getOperation()
770     {
771         OperationFacade getOperation3r = null;
772         // parameters has no pre constraints
773         Object result = handleGetOperation();
774         MetafacadeBase shieldedResult = this.shieldedElement(result);
775         try
776         {
777             getOperation3r = (OperationFacade)shieldedResult;
778         }
779         catch (ClassCastException ex)
780         {
781             // Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
782             ParameterFacadeLogic.logger.warn("incorrect metafacade cast for ParameterFacadeLogic.getOperation OperationFacade " + result + ": " + shieldedResult);
783         }
784         // parameters has no post constraints
785         return getOperation3r;
786     }
787 
788     /**
789      * UML Specific type is transformed by shieldedElements to AndroMDA Metafacade type
790      * @return Object
791      */
792     protected abstract Object handleGetOperation();
793 
794     /**
795      * <p><b>Constraint:</b> org::andromda::metafacades::uml::ParameterFacade::parameter needs a type</p>
796      * <p><b>Error:</b> Each parameter needs a type, you cannot leave the type unspecified.</p>
797      * <p><b>OCL:</b> context ParameterFacade
798 inv: return = false implies type.name->notEmpty()</p>
799      * <p><b>Constraint:</b> org::andromda::metafacades::uml::ParameterFacade::non return type parameters must be named</p>
800      * <p><b>Error:</b> Each parameter that is NOT a return parameter must have a non-empty name.</p>
801      * <p><b>OCL:</b> context ParameterFacade
802 inv: return = false 
803 implies name -> notEmpty()</p>
804      * <p><b>Constraint:</b> org::andromda::metafacades::uml::ParameterFacade::primitive parameter cannot be used in Collection</p>
805      * <p><b>Error:</b> Primitive parameters cannot be used in Collections (multiplicity > 1). Use the wrapped type instead.</p>
806      * <p><b>OCL:</b> context ParameterFacade inv: type.primitive implies (many = false)</p>
807      * <p><b>Constraint:</b> org::andromda::metafacades::uml::ParameterFacade::primitive parameter must be required</p>
808      * <p><b>Error:</b> Primitive operation parameters must have a multiplicity lower bound > 0 (must be required). Use a wrapped type, or change the multiplicity.</p>
809      * <p><b>OCL:</b> context ParameterFacade inv: type.primitive implies (lower > 0)</p>
810      * <p><b>Constraint:</b> org::andromda::metafacades::uml::ParameterFacade::wrapped primitive parameter should not be required</p>
811      * <p><b>Error:</b> Wrapped primitive operation parameters must have a multiplicity lower bound = 0 (must be optional). Use the unwrapped type, or change the multiplicity.</p>
812      * <p><b>OCL:</b> context ParameterFacade inv: type.wrappedPrimitive and many = false implies (lower = 0)</p>
813      * @param validationMessages Collection<ModelValidationMessage>
814      * @see ModelElementFacadeLogicImpl#validateInvariants(Collection validationMessages)
815      */
816     @Override
817     public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
818     {
819         super.validateInvariants(validationMessages);
820         try
821         {
822             final Object contextElement = this.THIS();
823             boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(OCLExpressions.equal(OCLIntrospector.invoke(contextElement,"return"),false))).booleanValue()?OCLCollections.notEmpty(OCLIntrospector.invoke(contextElement,"type.name")):true));
824             if (!constraintValid)
825             {
826                 validationMessages.add(
827                     new ModelValidationMessage(
828                         (MetafacadeBase)contextElement ,
829                         "org::andromda::metafacades::uml::ParameterFacade::parameter needs a type",
830                         "Each parameter needs a type, you cannot leave the type unspecified."));
831             }
832         }
833         catch (Throwable th)
834         {
835             Throwable cause = th.getCause();
836             int depth = 0; // Some throwables have infinite recursion
837             while (cause != null && depth < 7)
838             {
839                 th = cause;
840                 depth++;
841             }
842             logger.error("Error validating constraint 'org::andromda::metafacades::uml::ParameterFacade::parameter needs a type' ON "
843                 + this.THIS().toString() + ": " + th.getMessage(), th);
844         }
845         try
846         {
847             final Object contextElement = this.THIS();
848             boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(OCLExpressions.equal(OCLIntrospector.invoke(contextElement,"return"),false))).booleanValue()?OCLCollections.notEmpty(OCLIntrospector.invoke(contextElement,"name")):true));
849             if (!constraintValid)
850             {
851                 validationMessages.add(
852                     new ModelValidationMessage(
853                         (MetafacadeBase)contextElement ,
854                         "org::andromda::metafacades::uml::ParameterFacade::non return type parameters must be named",
855                         "Each parameter that is NOT a return parameter must have a non-empty name."));
856             }
857         }
858         catch (Throwable th)
859         {
860             Throwable cause = th.getCause();
861             int depth = 0; // Some throwables have infinite recursion
862             while (cause != null && depth < 7)
863             {
864                 th = cause;
865                 depth++;
866             }
867             logger.error("Error validating constraint 'org::andromda::metafacades::uml::ParameterFacade::non return type parameters must be named' ON "
868                 + this.THIS().toString() + ": " + th.getMessage(), th);
869         }
870         try
871         {
872             final Object contextElement = this.THIS();
873             boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"type.primitive"))).booleanValue()?(OCLExpressions.equal(OCLIntrospector.invoke(contextElement,"many"),false)):true));
874             if (!constraintValid)
875             {
876                 validationMessages.add(
877                     new ModelValidationMessage(
878                         (MetafacadeBase)contextElement ,
879                         "org::andromda::metafacades::uml::ParameterFacade::primitive parameter cannot be used in Collection",
880                         "Primitive parameters cannot be used in Collections (multiplicity > 1). Use the wrapped type instead."));
881             }
882         }
883         catch (Throwable th)
884         {
885             Throwable cause = th.getCause();
886             int depth = 0; // Some throwables have infinite recursion
887             while (cause != null && depth < 7)
888             {
889                 th = cause;
890                 depth++;
891             }
892             logger.error("Error validating constraint 'org::andromda::metafacades::uml::ParameterFacade::primitive parameter cannot be used in Collection' ON "
893                 + this.THIS().toString() + ": " + th.getMessage(), th);
894         }
895         try
896         {
897             final Object contextElement = this.THIS();
898             boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"type.primitive"))).booleanValue()?(OCLExpressions.greater(OCLIntrospector.invoke(contextElement,"lower"),0)):true));
899             if (!constraintValid)
900             {
901                 validationMessages.add(
902                     new ModelValidationMessage(
903                         (MetafacadeBase)contextElement ,
904                         "org::andromda::metafacades::uml::ParameterFacade::primitive parameter must be required",
905                         "Primitive operation parameters must have a multiplicity lower bound > 0 (must be required). Use a wrapped type, or change the multiplicity."));
906             }
907         }
908         catch (Throwable th)
909         {
910             Throwable cause = th.getCause();
911             int depth = 0; // Some throwables have infinite recursion
912             while (cause != null && depth < 7)
913             {
914                 th = cause;
915                 depth++;
916             }
917             logger.error("Error validating constraint 'org::andromda::metafacades::uml::ParameterFacade::primitive parameter must be required' ON "
918                 + this.THIS().toString() + ": " + th.getMessage(), th);
919         }
920         try
921         {
922             final Object contextElement = this.THIS();
923             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));
924             if (!constraintValid)
925             {
926                 validationMessages.add(
927                     new ModelValidationMessage(
928                         (MetafacadeBase)contextElement ,
929                         "org::andromda::metafacades::uml::ParameterFacade::wrapped primitive parameter should not be required",
930                         "Wrapped primitive operation parameters must have a multiplicity lower bound = 0 (must be optional). Use the unwrapped type, or change the multiplicity."));
931             }
932         }
933         catch (Throwable th)
934         {
935             Throwable cause = th.getCause();
936             int depth = 0; // Some throwables have infinite recursion
937             while (cause != null && depth < 7)
938             {
939                 th = cause;
940                 depth++;
941             }
942             logger.error("Error validating constraint 'org::andromda::metafacades::uml::ParameterFacade::wrapped primitive parameter should not be required' ON "
943                 + this.THIS().toString() + ": " + th.getMessage(), th);
944         }
945     }
946 }