1 // license-header java merge-point
2 //
3 // Attention: generated code (by MetafacadeLogic.vsl) - do not modify!
4 //
5 package org.andromda.cartridges.bpm4struts.metafacades;
6
7 import java.util.Collection;
8 import org.andromda.core.common.Introspector;
9 import org.andromda.core.metafacade.MetafacadeBase;
10 import org.andromda.core.metafacade.MetafacadeFactory;
11 import org.andromda.core.metafacade.ModelValidationMessage;
12 import org.andromda.metafacades.uml.ClassifierFacade;
13 import org.andromda.metafacades.uml.ConstraintFacade;
14 import org.andromda.metafacades.uml.DependencyFacade;
15 import org.andromda.metafacades.uml.EnumerationFacade;
16 import org.andromda.metafacades.uml.ManageableEntityAttribute;
17 import org.andromda.metafacades.uml.ModelElementFacade;
18 import org.andromda.metafacades.uml.ModelFacade;
19 import org.andromda.metafacades.uml.PackageFacade;
20 import org.andromda.metafacades.uml.StateMachineFacade;
21 import org.andromda.metafacades.uml.StereotypeFacade;
22 import org.andromda.metafacades.uml.TaggedValueFacade;
23 import org.andromda.metafacades.uml.TemplateParameterFacade;
24 import org.andromda.metafacades.uml.TypeMappings;
25 import org.andromda.translation.ocl.validation.OCLCollections;
26 import org.andromda.translation.ocl.validation.OCLExpressions;
27 import org.andromda.translation.ocl.validation.OCLIntrospector;
28 import org.andromda.translation.ocl.validation.OCLResultEnsurer;
29 import org.apache.log4j.Logger;
30
31 /**
32 * TODO: Model Documentation for
33 * org.andromda.cartridges.bpm4struts.metafacades.StrutsManageableEntityAttribute
34 * MetafacadeLogic for StrutsManageableEntityAttribute
35 *
36 * @see StrutsManageableEntityAttribute
37 */
38 public abstract class StrutsManageableEntityAttributeLogic
39 extends MetafacadeBase
40 implements StrutsManageableEntityAttribute
41 {
42 /**
43 * The underlying UML object
44 * @see Object
45 */
46 protected Object metaObject;
47
48 /** Create Metafacade implementation instance using the MetafacadeFactory from the context
49 * @param metaObjectIn
50 * @param context
51 */
52 protected StrutsManageableEntityAttributeLogic(Object metaObjectIn, String context)
53 {
54 super(metaObjectIn, getContext(context));
55 this.superManageableEntityAttribute =
56 (ManageableEntityAttribute)
57 MetafacadeFactory.getInstance().createFacadeImpl(
58 "org.andromda.metafacades.uml.ManageableEntityAttribute",
59 metaObjectIn,
60 getContext(context));
61 this.metaObject = metaObjectIn;
62 }
63
64 /**
65 * The logger instance.
66 */
67 private static final Logger logger = Logger.getLogger(StrutsManageableEntityAttributeLogic.class);
68
69 /**
70 * Gets the context for this metafacade logic instance.
71 * @param context String. Set to StrutsManageableEntityAttribute if null
72 * @return context String
73 */
74 private static String getContext(String context)
75 {
76 if (context == null)
77 {
78 context = "org.andromda.cartridges.bpm4struts.metafacades.StrutsManageableEntityAttribute";
79 }
80 return context;
81 }
82
83 private ManageableEntityAttribute superManageableEntityAttribute;
84 private boolean superManageableEntityAttributeInitialized = false;
85
86 /**
87 * Gets the ManageableEntityAttribute parent instance.
88 * @return this.superManageableEntityAttribute ManageableEntityAttribute
89 */
90 private ManageableEntityAttribute getSuperManageableEntityAttribute()
91 {
92 if (!this.superManageableEntityAttributeInitialized)
93 {
94 ((MetafacadeBase)this.superManageableEntityAttribute).setMetafacadeContext(this.getMetafacadeContext());
95 this.superManageableEntityAttributeInitialized = true;
96 }
97 return this.superManageableEntityAttribute;
98 }
99
100 /** Reset context only for non-root metafacades
101 * @param context
102 * @see MetafacadeBase#resetMetafacadeContext(String context)
103 */
104 @Override
105 public void resetMetafacadeContext(String context)
106 {
107 if (!this.contextRoot) // reset context only for non-root metafacades
108 {
109 context = getContext(context); // to have same value as in original constructor call
110 setMetafacadeContext (context);
111 if (this.superManageableEntityAttributeInitialized)
112 {
113 ((MetafacadeBase)this.superManageableEntityAttribute).resetMetafacadeContext(context);
114 }
115 }
116 }
117
118 /**
119 * @return boolean true always
120 * @see StrutsManageableEntityAttribute
121 */
122 public boolean isStrutsManageableEntityAttributeMetaType()
123 {
124 return true;
125 }
126
127 // --------------- attributes ---------------------
128
129 /**
130 * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsManageableEntityAttribute#getMessageKey()
131 * @return String
132 */
133 protected abstract String handleGetMessageKey();
134
135 private String __messageKey1a;
136 private boolean __messageKey1aSet = false;
137
138 /**
139 * TODO: Model Documentation for
140 * org.andromda.cartridges.bpm4struts.metafacades.StrutsManageableEntityAttribute.messageKey
141 * @return (String)handleGetMessageKey()
142 */
143 public final String getMessageKey()
144 {
145 String messageKey1a = this.__messageKey1a;
146 if (!this.__messageKey1aSet)
147 {
148 // messageKey has no pre constraints
149 messageKey1a = handleGetMessageKey();
150 // messageKey has no post constraints
151 this.__messageKey1a = messageKey1a;
152 if (isMetafacadePropertyCachingEnabled())
153 {
154 this.__messageKey1aSet = true;
155 }
156 }
157 return messageKey1a;
158 }
159
160 /**
161 * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsManageableEntityAttribute#getMessageValue()
162 * @return String
163 */
164 protected abstract String handleGetMessageValue();
165
166 private String __messageValue2a;
167 private boolean __messageValue2aSet = false;
168
169 /**
170 * TODO: Model Documentation for
171 * org.andromda.cartridges.bpm4struts.metafacades.StrutsManageableEntityAttribute.messageValue
172 * @return (String)handleGetMessageValue()
173 */
174 public final String getMessageValue()
175 {
176 String messageValue2a = this.__messageValue2a;
177 if (!this.__messageValue2aSet)
178 {
179 // messageValue has no pre constraints
180 messageValue2a = handleGetMessageValue();
181 // messageValue has no post constraints
182 this.__messageValue2a = messageValue2a;
183 if (isMetafacadePropertyCachingEnabled())
184 {
185 this.__messageValue2aSet = true;
186 }
187 }
188 return messageValue2a;
189 }
190
191 /**
192 * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsManageableEntityAttribute#getDateFormat()
193 * @return String
194 */
195 protected abstract String handleGetDateFormat();
196
197 private String __dateFormat3a;
198 private boolean __dateFormat3aSet = false;
199
200 /**
201 * The String format to use when referring to this date, only makes sense when the type is a
202 * date type.
203 * @return (String)handleGetDateFormat()
204 */
205 public final String getDateFormat()
206 {
207 String dateFormat3a = this.__dateFormat3a;
208 if (!this.__dateFormat3aSet)
209 {
210 // dateFormat has no pre constraints
211 dateFormat3a = handleGetDateFormat();
212 // dateFormat has no post constraints
213 this.__dateFormat3a = dateFormat3a;
214 if (isMetafacadePropertyCachingEnabled())
215 {
216 this.__dateFormat3aSet = true;
217 }
218 }
219 return dateFormat3a;
220 }
221
222 /**
223 * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsManageableEntityAttribute#isNeedsFileUpload()
224 * @return boolean
225 */
226 protected abstract boolean handleIsNeedsFileUpload();
227
228 private boolean __needsFileUpload4a;
229 private boolean __needsFileUpload4aSet = false;
230
231 /**
232 * True if this attribute is of a type that cannot easily be represented as a textual string and
233 * would be an ideal candidate for HTTP's support for file-upload.
234 * @return (boolean)handleIsNeedsFileUpload()
235 */
236 public final boolean isNeedsFileUpload()
237 {
238 boolean needsFileUpload4a = this.__needsFileUpload4a;
239 if (!this.__needsFileUpload4aSet)
240 {
241 // needsFileUpload has no pre constraints
242 needsFileUpload4a = handleIsNeedsFileUpload();
243 // needsFileUpload has no post constraints
244 this.__needsFileUpload4a = needsFileUpload4a;
245 if (isMetafacadePropertyCachingEnabled())
246 {
247 this.__needsFileUpload4aSet = true;
248 }
249 }
250 return needsFileUpload4a;
251 }
252
253 /**
254 * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsManageableEntityAttribute#isHidden()
255 * @return boolean
256 */
257 protected abstract boolean handleIsHidden();
258
259 private boolean __hidden5a;
260 private boolean __hidden5aSet = false;
261
262 /**
263 * Whether or not this attribute should be hidden from the view
264 * @return (boolean)handleIsHidden()
265 */
266 public final boolean isHidden()
267 {
268 boolean hidden5a = this.__hidden5a;
269 if (!this.__hidden5aSet)
270 {
271 // hidden has no pre constraints
272 hidden5a = handleIsHidden();
273 // hidden has no post constraints
274 this.__hidden5a = hidden5a;
275 if (isMetafacadePropertyCachingEnabled())
276 {
277 this.__hidden5aSet = true;
278 }
279 }
280 return hidden5a;
281 }
282
283 /**
284 * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsManageableEntityAttribute#getWidgetType()
285 * @return String
286 */
287 protected abstract String handleGetWidgetType();
288
289 private String __widgetType6a;
290 private boolean __widgetType6aSet = false;
291
292 /**
293 * The widget to use when rendering this attribute
294 * @return (String)handleGetWidgetType()
295 */
296 public final String getWidgetType()
297 {
298 String widgetType6a = this.__widgetType6a;
299 if (!this.__widgetType6aSet)
300 {
301 // widgetType has no pre constraints
302 widgetType6a = handleGetWidgetType();
303 // widgetType has no post constraints
304 this.__widgetType6a = widgetType6a;
305 if (isMetafacadePropertyCachingEnabled())
306 {
307 this.__widgetType6aSet = true;
308 }
309 }
310 return widgetType6a;
311 }
312
313 /**
314 * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsManageableEntityAttribute#isStrictDateFormat()
315 * @return boolean
316 */
317 protected abstract boolean handleIsStrictDateFormat();
318
319 private boolean __strictDateFormat7a;
320 private boolean __strictDateFormat7aSet = false;
321
322 /**
323 * True if this field is a date type and the date format is not be interpreted strictly.
324 * @return (boolean)handleIsStrictDateFormat()
325 */
326 public final boolean isStrictDateFormat()
327 {
328 boolean strictDateFormat7a = this.__strictDateFormat7a;
329 if (!this.__strictDateFormat7aSet)
330 {
331 // strictDateFormat has no pre constraints
332 strictDateFormat7a = handleIsStrictDateFormat();
333 // strictDateFormat has no post constraints
334 this.__strictDateFormat7a = strictDateFormat7a;
335 if (isMetafacadePropertyCachingEnabled())
336 {
337 this.__strictDateFormat7aSet = true;
338 }
339 }
340 return strictDateFormat7a;
341 }
342
343 /**
344 * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsManageableEntityAttribute#getFieldRowCount()
345 * @return Integer
346 */
347 protected abstract Integer handleGetFieldRowCount();
348
349 private Integer __fieldRowCount8a;
350 private boolean __fieldRowCount8aSet = false;
351
352 /**
353 * The number of rows for this field, null if default browser value is desired.
354 * @return (Integer)handleGetFieldRowCount()
355 */
356 public final Integer getFieldRowCount()
357 {
358 Integer fieldRowCount8a = this.__fieldRowCount8a;
359 if (!this.__fieldRowCount8aSet)
360 {
361 // fieldRowCount has no pre constraints
362 fieldRowCount8a = handleGetFieldRowCount();
363 // fieldRowCount has no post constraints
364 this.__fieldRowCount8a = fieldRowCount8a;
365 if (isMetafacadePropertyCachingEnabled())
366 {
367 this.__fieldRowCount8aSet = true;
368 }
369 }
370 return fieldRowCount8a;
371 }
372
373 /**
374 * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsManageableEntityAttribute#getFieldColumnCount()
375 * @return Integer
376 */
377 protected abstract Integer handleGetFieldColumnCount();
378
379 private Integer __fieldColumnCount9a;
380 private boolean __fieldColumnCount9aSet = false;
381
382 /**
383 * The number of columns for this field, null if default browser value is desired.
384 * @return (Integer)handleGetFieldColumnCount()
385 */
386 public final Integer getFieldColumnCount()
387 {
388 Integer fieldColumnCount9a = this.__fieldColumnCount9a;
389 if (!this.__fieldColumnCount9aSet)
390 {
391 // fieldColumnCount has no pre constraints
392 fieldColumnCount9a = handleGetFieldColumnCount();
393 // fieldColumnCount has no post constraints
394 this.__fieldColumnCount9a = fieldColumnCount9a;
395 if (isMetafacadePropertyCachingEnabled())
396 {
397 this.__fieldColumnCount9aSet = true;
398 }
399 }
400 return fieldColumnCount9a;
401 }
402
403 /**
404 * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsManageableEntityAttribute#isSafeNamePresent()
405 * @return boolean
406 */
407 protected abstract boolean handleIsSafeNamePresent();
408
409 private boolean __safeNamePresent10a;
410 private boolean __safeNamePresent10aSet = false;
411
412 /**
413 * True if this parameter has a name that can properly be handled by Jakarta commons (this lib
414 * is used by Struts but contains a bug)
415 * @return (boolean)handleIsSafeNamePresent()
416 */
417 public final boolean isSafeNamePresent()
418 {
419 boolean safeNamePresent10a = this.__safeNamePresent10a;
420 if (!this.__safeNamePresent10aSet)
421 {
422 // safeNamePresent has no pre constraints
423 safeNamePresent10a = handleIsSafeNamePresent();
424 // safeNamePresent has no post constraints
425 this.__safeNamePresent10a = safeNamePresent10a;
426 if (isMetafacadePropertyCachingEnabled())
427 {
428 this.__safeNamePresent10aSet = true;
429 }
430 }
431 return safeNamePresent10a;
432 }
433
434 /**
435 * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsManageableEntityAttribute#getOnlineHelpKey()
436 * @return String
437 */
438 protected abstract String handleGetOnlineHelpKey();
439
440 private String __onlineHelpKey11a;
441 private boolean __onlineHelpKey11aSet = false;
442
443 /**
444 * The key to lookup the online help documentation. This documentation is gathered from the
445 * documentation entered by the user, as well as analyzing the model.
446 * @return (String)handleGetOnlineHelpKey()
447 */
448 public final String getOnlineHelpKey()
449 {
450 String onlineHelpKey11a = this.__onlineHelpKey11a;
451 if (!this.__onlineHelpKey11aSet)
452 {
453 // onlineHelpKey has no pre constraints
454 onlineHelpKey11a = handleGetOnlineHelpKey();
455 // onlineHelpKey has no post constraints
456 this.__onlineHelpKey11a = onlineHelpKey11a;
457 if (isMetafacadePropertyCachingEnabled())
458 {
459 this.__onlineHelpKey11aSet = true;
460 }
461 }
462 return onlineHelpKey11a;
463 }
464
465 /**
466 * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsManageableEntityAttribute#getOnlineHelpValue()
467 * @return String
468 */
469 protected abstract String handleGetOnlineHelpValue();
470
471 private String __onlineHelpValue12a;
472 private boolean __onlineHelpValue12aSet = false;
473
474 /**
475 * The online help documentation. This documentation is gathered from the documentation entered
476 * by the user, as well as analyzing the model. The format is HTML without any style.
477 * @return (String)handleGetOnlineHelpValue()
478 */
479 public final String getOnlineHelpValue()
480 {
481 String onlineHelpValue12a = this.__onlineHelpValue12a;
482 if (!this.__onlineHelpValue12aSet)
483 {
484 // onlineHelpValue has no pre constraints
485 onlineHelpValue12a = handleGetOnlineHelpValue();
486 // onlineHelpValue has no post constraints
487 this.__onlineHelpValue12a = onlineHelpValue12a;
488 if (isMetafacadePropertyCachingEnabled())
489 {
490 this.__onlineHelpValue12aSet = true;
491 }
492 }
493 return onlineHelpValue12a;
494 }
495
496 /**
497 * @return true
498 * @see ManageableEntityAttribute
499 */
500 public boolean isManageableEntityAttributeMetaType()
501 {
502 return true;
503 }
504
505 /**
506 * @return true
507 * @see org.andromda.metafacades.uml.EntityAttribute
508 */
509 public boolean isEntityAttributeMetaType()
510 {
511 return true;
512 }
513
514 /**
515 * @return true
516 * @see org.andromda.metafacades.uml.AttributeFacade
517 */
518 public boolean isAttributeFacadeMetaType()
519 {
520 return true;
521 }
522
523 /**
524 * @return true
525 * @see ModelElementFacade
526 */
527 public boolean isModelElementFacadeMetaType()
528 {
529 return true;
530 }
531
532 // ----------- delegates to ManageableEntityAttribute ------------
533 /**
534 * Searches the given feature for the specified tag.
535 * If the follow boolean is set to true then the search will continue from the class attribute
536 * to the class itself and then up the class hierarchy.
537 * @see org.andromda.metafacades.uml.AttributeFacade#findTaggedValue(String name, boolean follow)
538 */
539 public Object findTaggedValue(String name, boolean follow)
540 {
541 return this.getSuperManageableEntityAttribute().findTaggedValue(name, follow);
542 }
543
544 /**
545 * The default value of the attribute. This is the value given if no value is defined.
546 * @see org.andromda.metafacades.uml.AttributeFacade#getDefaultValue()
547 */
548 public String getDefaultValue()
549 {
550 return this.getSuperManageableEntityAttribute().getDefaultValue();
551 }
552
553 /**
554 * If the attribute is an enumeration literal this represents the owning enumeration. Can be
555 * empty.
556 * @see org.andromda.metafacades.uml.AttributeFacade#getEnumeration()
557 */
558 public EnumerationFacade getEnumeration()
559 {
560 return this.getSuperManageableEntityAttribute().getEnumeration();
561 }
562
563 /**
564 * Returns the enumeration literal parameters defined by tagged value as a comma separated list.
565 * @see org.andromda.metafacades.uml.AttributeFacade#getEnumerationLiteralParameters()
566 */
567 public String getEnumerationLiteralParameters()
568 {
569 return this.getSuperManageableEntityAttribute().getEnumerationLiteralParameters();
570 }
571
572 /**
573 * The value for this attribute if it is an enumeration literal, null otherwise. The default
574 * value is returned as a String if it has been specified, if it's not specified this
575 * attribute's name is assumed.
576 * @see org.andromda.metafacades.uml.AttributeFacade#getEnumerationValue()
577 */
578 public String getEnumerationValue()
579 {
580 return this.getSuperManageableEntityAttribute().getEnumerationValue();
581 }
582
583 /**
584 * The name of the accessor operation that would retrieve this attribute's value.
585 * @see org.andromda.metafacades.uml.AttributeFacade#getGetterName()
586 */
587 public String getGetterName()
588 {
589 return this.getSuperManageableEntityAttribute().getGetterName();
590 }
591
592 /**
593 * The name of the type that is returned on the accessor and mutator operations, determined in
594 * part by the multiplicity.
595 * @see org.andromda.metafacades.uml.AttributeFacade#getGetterSetterTypeName()
596 */
597 public String getGetterSetterTypeName()
598 {
599 return this.getSuperManageableEntityAttribute().getGetterSetterTypeName();
600 }
601
602 /**
603 * the lower value for the multiplicity
604 * -only applicable for UML2
605 * @see org.andromda.metafacades.uml.AttributeFacade#getLower()
606 */
607 public int getLower()
608 {
609 return this.getSuperManageableEntityAttribute().getLower();
610 }
611
612 /**
613 * Gets the classifier who is the owner of the attributes.
614 * @see org.andromda.metafacades.uml.AttributeFacade#getOwner()
615 */
616 public ClassifierFacade getOwner()
617 {
618 return this.getSuperManageableEntityAttribute().getOwner();
619 }
620
621 /**
622 * The name of the mutator operation that would retrieve this attribute's value.
623 * @see org.andromda.metafacades.uml.AttributeFacade#getSetterName()
624 */
625 public String getSetterName()
626 {
627 return this.getSuperManageableEntityAttribute().getSetterName();
628 }
629
630 /**
631 * The classifier owning this attribute.
632 * @see org.andromda.metafacades.uml.AttributeFacade#getType()
633 */
634 public ClassifierFacade getType()
635 {
636 return this.getSuperManageableEntityAttribute().getType();
637 }
638
639 /**
640 * the upper value for the multiplicity (will be -1 for *)
641 * -only applicable for UML2
642 * @see org.andromda.metafacades.uml.AttributeFacade#getUpper()
643 */
644 public int getUpper()
645 {
646 return this.getSuperManageableEntityAttribute().getUpper();
647 }
648
649 /**
650 * True if this attribute can only be set.
651 * @see org.andromda.metafacades.uml.AttributeFacade#isAddOnly()
652 */
653 public boolean isAddOnly()
654 {
655 return this.getSuperManageableEntityAttribute().isAddOnly();
656 }
657
658 /**
659 * True if this attribute can be modified.
660 * @see org.andromda.metafacades.uml.AttributeFacade#isChangeable()
661 */
662 public boolean isChangeable()
663 {
664 return this.getSuperManageableEntityAttribute().isChangeable();
665 }
666
667 /**
668 * Indicates if the default value is present.
669 * @see org.andromda.metafacades.uml.AttributeFacade#isDefaultValuePresent()
670 */
671 public boolean isDefaultValuePresent()
672 {
673 return this.getSuperManageableEntityAttribute().isDefaultValuePresent();
674 }
675
676 /**
677 * If the attribute is derived (its value is computed). UML2 only. UML14 always returns false.
678 * Default=false.
679 * @see org.andromda.metafacades.uml.AttributeFacade#isDerived()
680 */
681 public boolean isDerived()
682 {
683 return this.getSuperManageableEntityAttribute().isDerived();
684 }
685
686 /**
687 * True if this attribute is owned by an enumeration.
688 * @see org.andromda.metafacades.uml.AttributeFacade#isEnumerationLiteral()
689 */
690 public boolean isEnumerationLiteral()
691 {
692 return this.getSuperManageableEntityAttribute().isEnumerationLiteral();
693 }
694
695 /**
696 * Returns true if enumeration literal parameters exist (defined by tagged value) for the
697 * literal.
698 * @see org.andromda.metafacades.uml.AttributeFacade#isEnumerationLiteralParametersExist()
699 */
700 public boolean isEnumerationLiteralParametersExist()
701 {
702 return this.getSuperManageableEntityAttribute().isEnumerationLiteralParametersExist();
703 }
704
705 /**
706 * True if this attribute is owned by an enumeration but is defined as a member variable (NOT a
707 * literal).
708 * @see org.andromda.metafacades.uml.AttributeFacade#isEnumerationMember()
709 */
710 public boolean isEnumerationMember()
711 {
712 return this.getSuperManageableEntityAttribute().isEnumerationMember();
713 }
714
715 /**
716 * IsLeaf property in the operation. If true, operation is final, cannot be extended or
717 * implemented by a descendant.
718 * @see org.andromda.metafacades.uml.AttributeFacade#isLeaf()
719 */
720 public boolean isLeaf()
721 {
722 return this.getSuperManageableEntityAttribute().isLeaf();
723 }
724
725 /**
726 * Whether or not this attribute has a multiplicity greater than 1.
727 * @see org.andromda.metafacades.uml.AttributeFacade#isMany()
728 */
729 public boolean isMany()
730 {
731 return this.getSuperManageableEntityAttribute().isMany();
732 }
733
734 /**
735 * Indicates whether or not the attributes are ordered (if multiplicity is greater than 1).
736 * @see org.andromda.metafacades.uml.AttributeFacade#isOrdered()
737 */
738 public boolean isOrdered()
739 {
740 return this.getSuperManageableEntityAttribute().isOrdered();
741 }
742
743 /**
744 * Whether or not this attribute can be modified.
745 * @see org.andromda.metafacades.uml.AttributeFacade#isReadOnly()
746 */
747 public boolean isReadOnly()
748 {
749 return this.getSuperManageableEntityAttribute().isReadOnly();
750 }
751
752 /**
753 * Whether or not the multiplicity of this attribute is 1.
754 * @see org.andromda.metafacades.uml.AttributeFacade#isRequired()
755 */
756 public boolean isRequired()
757 {
758 return this.getSuperManageableEntityAttribute().isRequired();
759 }
760
761 /**
762 * Indicates if this attribute is 'static', meaning it has a classifier scope.
763 * @see org.andromda.metafacades.uml.AttributeFacade#isStatic()
764 */
765 public boolean isStatic()
766 {
767 return this.getSuperManageableEntityAttribute().isStatic();
768 }
769
770 /**
771 * If the attribute is unique within the Collection type. UML2 only. UML14 always returns false.
772 * Unique+Ordered determines the implementation Collection type. Default=false.
773 * @see org.andromda.metafacades.uml.AttributeFacade#isUnique()
774 */
775 public boolean isUnique()
776 {
777 return this.getSuperManageableEntityAttribute().isUnique();
778 }
779
780 /**
781 * The name of the index to create on a column that persists the entity attribute.
782 * @see org.andromda.metafacades.uml.EntityAttribute#getColumnIndex()
783 */
784 public String getColumnIndex()
785 {
786 return this.getSuperManageableEntityAttribute().getColumnIndex();
787 }
788
789 /**
790 * The length of the column that persists this entity attribute.
791 * @see org.andromda.metafacades.uml.EntityAttribute#getColumnLength()
792 */
793 public String getColumnLength()
794 {
795 return this.getSuperManageableEntityAttribute().getColumnLength();
796 }
797
798 /**
799 * The name of the table column to which this entity is mapped.
800 * @see org.andromda.metafacades.uml.EntityAttribute#getColumnName()
801 */
802 public String getColumnName()
803 {
804 return this.getSuperManageableEntityAttribute().getColumnName();
805 }
806
807 /**
808 * The PIM to language specific mappings for JDBC.
809 * @see org.andromda.metafacades.uml.EntityAttribute#getJdbcMappings()
810 */
811 public TypeMappings getJdbcMappings()
812 {
813 return this.getSuperManageableEntityAttribute().getJdbcMappings();
814 }
815
816 /**
817 * The JDBC type for this entity attribute.
818 * @see org.andromda.metafacades.uml.EntityAttribute#getJdbcType()
819 */
820 public String getJdbcType()
821 {
822 return this.getSuperManageableEntityAttribute().getJdbcType();
823 }
824
825 /**
826 * The SQL mappings (i.e. the mappings which provide PIM to SQL mappings).
827 * @see org.andromda.metafacades.uml.EntityAttribute#getSqlMappings()
828 */
829 public TypeMappings getSqlMappings()
830 {
831 return this.getSuperManageableEntityAttribute().getSqlMappings();
832 }
833
834 /**
835 * The SQL type for this attribute.
836 * @see org.andromda.metafacades.uml.EntityAttribute#getSqlType()
837 */
838 public String getSqlType()
839 {
840 return this.getSuperManageableEntityAttribute().getSqlType();
841 }
842
843 /**
844 * The name of the unique-key that this unique attribute belongs
845 * @see org.andromda.metafacades.uml.EntityAttribute#getUniqueGroup()
846 */
847 public String getUniqueGroup()
848 {
849 return this.getSuperManageableEntityAttribute().getUniqueGroup();
850 }
851
852 /**
853 * True if this attribute is an identifier for its entity.
854 * @see org.andromda.metafacades.uml.EntityAttribute#isIdentifier()
855 */
856 public boolean isIdentifier()
857 {
858 return this.getSuperManageableEntityAttribute().isIdentifier();
859 }
860
861 /**
862 * Indicates this attribute should be ignored by the persistence layer.
863 * @see org.andromda.metafacades.uml.EntityAttribute#isTransient()
864 */
865 public boolean isTransient()
866 {
867 return this.getSuperManageableEntityAttribute().isTransient();
868 }
869
870 /**
871 * Whether or not this attribute should be displayed.
872 * @see ManageableEntityAttribute#isDisplay()
873 */
874 public boolean isDisplay()
875 {
876 return this.getSuperManageableEntityAttribute().isDisplay();
877 }
878
879 /**
880 * Whether or not this attribute can be read in a call isolated from the rest (for example when
881 * downloading binary fields).
882 * @see ManageableEntityAttribute#isManageableGetterAvailable()
883 */
884 public boolean isManageableGetterAvailable()
885 {
886 return this.getSuperManageableEntityAttribute().isManageableGetterAvailable();
887 }
888
889 /**
890 * Copies all tagged values from the given ModelElementFacade to this model element facade.
891 * @see ModelElementFacade#copyTaggedValues(ModelElementFacade element)
892 */
893 public void copyTaggedValues(ModelElementFacade element)
894 {
895 this.getSuperManageableEntityAttribute().copyTaggedValues(element);
896 }
897
898 /**
899 * Finds the tagged value with the specified 'tagName'. In case there are more values the first
900 * one found will be returned.
901 * @see ModelElementFacade#findTaggedValue(String tagName)
902 */
903 public Object findTaggedValue(String tagName)
904 {
905 return this.getSuperManageableEntityAttribute().findTaggedValue(tagName);
906 }
907
908 /**
909 * Returns all the values for the tagged value with the specified name. The returned collection
910 * will contains only String instances, or will be empty. Never null.
911 * @see ModelElementFacade#findTaggedValues(String tagName)
912 */
913 public Collection<Object> findTaggedValues(String tagName)
914 {
915 return this.getSuperManageableEntityAttribute().findTaggedValues(tagName);
916 }
917
918 /**
919 * Returns the fully qualified name of the model element. The fully qualified name includes
920 * complete package qualified name of the underlying model element. The templates parameter will
921 * be replaced by the correct one given the binding relation of the parameter to this element.
922 * @see ModelElementFacade#getBindedFullyQualifiedName(ModelElementFacade bindedElement)
923 */
924 public String getBindedFullyQualifiedName(ModelElementFacade bindedElement)
925 {
926 return this.getSuperManageableEntityAttribute().getBindedFullyQualifiedName(bindedElement);
927 }
928
929 /**
930 * Gets all constraints belonging to the model element.
931 * @see ModelElementFacade#getConstraints()
932 */
933 public Collection<ConstraintFacade> getConstraints()
934 {
935 return this.getSuperManageableEntityAttribute().getConstraints();
936 }
937
938 /**
939 * Returns the constraints of the argument kind that have been placed onto this model. Typical
940 * kinds are "inv", "pre" and "post". Other kinds are possible.
941 * @see ModelElementFacade#getConstraints(String kind)
942 */
943 public Collection<ConstraintFacade> getConstraints(String kind)
944 {
945 return this.getSuperManageableEntityAttribute().getConstraints(kind);
946 }
947
948 /**
949 * Gets the documentation for the model element, The indent argument is prefixed to each line.
950 * By default this method wraps lines after 64 characters.
951 * This method is equivalent to <code>getDocumentation(indent, 64)</code>.
952 * @see ModelElementFacade#getDocumentation(String indent)
953 */
954 public String getDocumentation(String indent)
955 {
956 return this.getSuperManageableEntityAttribute().getDocumentation(indent);
957 }
958
959 /**
960 * This method returns the documentation for this model element, with the lines wrapped after
961 * the specified number of characters, values of less than 1 will indicate no line wrapping is
962 * required. By default paragraphs are returned as HTML.
963 * This method is equivalent to <code>getDocumentation(indent, lineLength, true)</code>.
964 * @see ModelElementFacade#getDocumentation(String indent, int lineLength)
965 */
966 public String getDocumentation(String indent, int lineLength)
967 {
968 return this.getSuperManageableEntityAttribute().getDocumentation(indent, lineLength);
969 }
970
971 /**
972 * This method returns the documentation for this model element, with the lines wrapped after
973 * the specified number of characters, values of less than 1 will indicate no line wrapping is
974 * required. HTML style determines if HTML Escaping is applied.
975 * @see ModelElementFacade#getDocumentation(String indent, int lineLength, boolean htmlStyle)
976 */
977 public String getDocumentation(String indent, int lineLength, boolean htmlStyle)
978 {
979 return this.getSuperManageableEntityAttribute().getDocumentation(indent, lineLength, htmlStyle);
980 }
981
982 /**
983 * The fully qualified name of this model element.
984 * @see ModelElementFacade#getFullyQualifiedName()
985 */
986 public String getFullyQualifiedName()
987 {
988 return this.getSuperManageableEntityAttribute().getFullyQualifiedName();
989 }
990
991 /**
992 * Returns the fully qualified name of the model element. The fully qualified name includes
993 * complete package qualified name of the underlying model element. If modelName is true, then
994 * the original name of the model element (the name contained within the model) will be the name
995 * returned, otherwise a name from a language mapping will be returned.
996 * @see ModelElementFacade#getFullyQualifiedName(boolean modelName)
997 */
998 public String getFullyQualifiedName(boolean modelName)
999 {
1000 return this.getSuperManageableEntityAttribute().getFullyQualifiedName(modelName);
1001 }
1002
1003 /**
1004 * Returns the fully qualified name as a path, the returned value always starts with out a slash
1005 * '/'.
1006 * @see ModelElementFacade#getFullyQualifiedNamePath()
1007 */
1008 public String getFullyQualifiedNamePath()
1009 {
1010 return this.getSuperManageableEntityAttribute().getFullyQualifiedNamePath();
1011 }
1012
1013 /**
1014 * Gets the unique identifier of the underlying model element.
1015 * @see ModelElementFacade#getId()
1016 */
1017 public String getId()
1018 {
1019 return this.getSuperManageableEntityAttribute().getId();
1020 }
1021
1022 /**
1023 * UML2: Retrieves the keywords for this element. Used to modify implementation properties which
1024 * are not represented by other properties, i.e. native, transient, volatile, synchronized,
1025 * (added annotations) override, deprecated. Can also be used to suppress compiler warnings:
1026 * (added annotations) unchecked, fallthrough, path, serial, finally, all. Annotations require
1027 * JDK5 compiler level.
1028 * @see ModelElementFacade#getKeywords()
1029 */
1030 public Collection<String> getKeywords()
1031 {
1032 return this.getSuperManageableEntityAttribute().getKeywords();
1033 }
1034
1035 /**
1036 * UML2: Retrieves a localized label for this named element.
1037 * @see ModelElementFacade#getLabel()
1038 */
1039 public String getLabel()
1040 {
1041 return this.getSuperManageableEntityAttribute().getLabel();
1042 }
1043
1044 /**
1045 * The language mappings that have been set for this model element.
1046 * @see ModelElementFacade#getLanguageMappings()
1047 */
1048 public TypeMappings getLanguageMappings()
1049 {
1050 return this.getSuperManageableEntityAttribute().getLanguageMappings();
1051 }
1052
1053 /**
1054 * Return the model containing this model element (multiple models may be loaded and processed
1055 * at the same time).
1056 * @see ModelElementFacade#getModel()
1057 */
1058 public ModelFacade getModel()
1059 {
1060 return this.getSuperManageableEntityAttribute().getModel();
1061 }
1062
1063 /**
1064 * The name of the model element.
1065 * @see ModelElementFacade#getName()
1066 */
1067 public String getName()
1068 {
1069 return this.getSuperManageableEntityAttribute().getName();
1070 }
1071
1072 /**
1073 * Gets the package to which this model element belongs.
1074 * @see ModelElementFacade#getPackage()
1075 */
1076 public ModelElementFacade getPackage()
1077 {
1078 return this.getSuperManageableEntityAttribute().getPackage();
1079 }
1080
1081 /**
1082 * The name of this model element's package.
1083 * @see ModelElementFacade#getPackageName()
1084 */
1085 public String getPackageName()
1086 {
1087 return this.getSuperManageableEntityAttribute().getPackageName();
1088 }
1089
1090 /**
1091 * Gets the package name (optionally providing the ability to retrieve the model name and not
1092 * the mapped name).
1093 * @see ModelElementFacade#getPackageName(boolean modelName)
1094 */
1095 public String getPackageName(boolean modelName)
1096 {
1097 return this.getSuperManageableEntityAttribute().getPackageName(modelName);
1098 }
1099
1100 /**
1101 * Returns the package as a path, the returned value always starts with out a slash '/'.
1102 * @see ModelElementFacade#getPackagePath()
1103 */
1104 public String getPackagePath()
1105 {
1106 return this.getSuperManageableEntityAttribute().getPackagePath();
1107 }
1108
1109 /**
1110 * UML2: Returns the value of the 'Qualified Name' attribute. A name which allows the
1111 * NamedElement to be identified within a hierarchy of nested Namespaces. It is constructed from
1112 * the names of the containing namespaces starting at the root of the hierarchy and ending with
1113 * the name of the NamedElement itself.
1114 * @see ModelElementFacade#getQualifiedName()
1115 */
1116 public String getQualifiedName()
1117 {
1118 return this.getSuperManageableEntityAttribute().getQualifiedName();
1119 }
1120
1121 /**
1122 * Gets the root package for the model element.
1123 * @see ModelElementFacade#getRootPackage()
1124 */
1125 public PackageFacade getRootPackage()
1126 {
1127 return this.getSuperManageableEntityAttribute().getRootPackage();
1128 }
1129
1130 /**
1131 * Gets the dependencies for which this model element is the source.
1132 * @see ModelElementFacade#getSourceDependencies()
1133 */
1134 public Collection<DependencyFacade> getSourceDependencies()
1135 {
1136 return this.getSuperManageableEntityAttribute().getSourceDependencies();
1137 }
1138
1139 /**
1140 * If this model element is the context of an activity graph, this represents that activity
1141 * graph.
1142 * @see ModelElementFacade#getStateMachineContext()
1143 */
1144 public StateMachineFacade getStateMachineContext()
1145 {
1146 return this.getSuperManageableEntityAttribute().getStateMachineContext();
1147 }
1148
1149 /**
1150 * The collection of ALL stereotype names for this model element.
1151 * @see ModelElementFacade#getStereotypeNames()
1152 */
1153 public Collection<String> getStereotypeNames()
1154 {
1155 return this.getSuperManageableEntityAttribute().getStereotypeNames();
1156 }
1157
1158 /**
1159 * Gets all stereotypes for this model element.
1160 * @see ModelElementFacade#getStereotypes()
1161 */
1162 public Collection<StereotypeFacade> getStereotypes()
1163 {
1164 return this.getSuperManageableEntityAttribute().getStereotypes();
1165 }
1166
1167 /**
1168 * Return the TaggedValues associated with this model element, under all stereotypes.
1169 * @see ModelElementFacade#getTaggedValues()
1170 */
1171 public Collection<TaggedValueFacade> getTaggedValues()
1172 {
1173 return this.getSuperManageableEntityAttribute().getTaggedValues();
1174 }
1175
1176 /**
1177 * Gets the dependencies for which this model element is the target.
1178 * @see ModelElementFacade#getTargetDependencies()
1179 */
1180 public Collection<DependencyFacade> getTargetDependencies()
1181 {
1182 return this.getSuperManageableEntityAttribute().getTargetDependencies();
1183 }
1184
1185 /**
1186 * Get the template parameter for this model element having the parameterName
1187 * @see ModelElementFacade#getTemplateParameter(String parameterName)
1188 */
1189 public Object getTemplateParameter(String parameterName)
1190 {
1191 return this.getSuperManageableEntityAttribute().getTemplateParameter(parameterName);
1192 }
1193
1194 /**
1195 * Get the template parameters for this model element
1196 * @see ModelElementFacade#getTemplateParameters()
1197 */
1198 public Collection<TemplateParameterFacade> getTemplateParameters()
1199 {
1200 return this.getSuperManageableEntityAttribute().getTemplateParameters();
1201 }
1202
1203 /**
1204 * The visibility (i.e. public, private, protected or package) of the model element, will
1205 * attempt a lookup for these values in the language mappings (if any).
1206 * @see ModelElementFacade#getVisibility()
1207 */
1208 public String getVisibility()
1209 {
1210 return this.getSuperManageableEntityAttribute().getVisibility();
1211 }
1212
1213 /**
1214 * Returns true if the model element has the exact stereotype (meaning no stereotype inheritance
1215 * is taken into account when searching for the stereotype), false otherwise.
1216 * @see ModelElementFacade#hasExactStereotype(String stereotypeName)
1217 */
1218 public boolean hasExactStereotype(String stereotypeName)
1219 {
1220 return this.getSuperManageableEntityAttribute().hasExactStereotype(stereotypeName);
1221 }
1222
1223 /**
1224 * Does the UML Element contain the named Keyword? Keywords can be separated by space, comma,
1225 * pipe, semicolon, or << >>
1226 * @see ModelElementFacade#hasKeyword(String keywordName)
1227 */
1228 public boolean hasKeyword(String keywordName)
1229 {
1230 return this.getSuperManageableEntityAttribute().hasKeyword(keywordName);
1231 }
1232
1233 /**
1234 * Returns true if the model element has the specified stereotype. If the stereotype itself
1235 * does not match, then a search will be made up the stereotype inheritance hierarchy, and if
1236 * one of the stereotype's ancestors has a matching name this method will return true, false
1237 * otherwise.
1238 * For example, if we have a certain stereotype called <<exception>> and a model element has a
1239 * stereotype called <<applicationException>> which extends <<exception>>, when calling this
1240 * method with 'stereotypeName' defined as 'exception' the method would return true since
1241 * <<applicationException>> inherits from <<exception>>. If you want to check if the model
1242 * element has the exact stereotype, then use the method 'hasExactStereotype' instead.
1243 * @see ModelElementFacade#hasStereotype(String stereotypeName)
1244 */
1245 public boolean hasStereotype(String stereotypeName)
1246 {
1247 return this.getSuperManageableEntityAttribute().hasStereotype(stereotypeName);
1248 }
1249
1250 /**
1251 * True if there are target dependencies from this element that are instances of BindingFacade.
1252 * Deprecated in UML2: Use TemplateBinding parameters instead of dependencies.
1253 * @see ModelElementFacade#isBindingDependenciesPresent()
1254 */
1255 public boolean isBindingDependenciesPresent()
1256 {
1257 return this.getSuperManageableEntityAttribute().isBindingDependenciesPresent();
1258 }
1259
1260 /**
1261 * Indicates if any constraints are present on this model element.
1262 * @see ModelElementFacade#isConstraintsPresent()
1263 */
1264 public boolean isConstraintsPresent()
1265 {
1266 return this.getSuperManageableEntityAttribute().isConstraintsPresent();
1267 }
1268
1269 /**
1270 * Indicates if any documentation is present on this model element.
1271 * @see ModelElementFacade#isDocumentationPresent()
1272 */
1273 public boolean isDocumentationPresent()
1274 {
1275 return this.getSuperManageableEntityAttribute().isDocumentationPresent();
1276 }
1277
1278 /**
1279 * True if this element name is a reserved word in Java, C#, ANSI or ISO C, C++, JavaScript.
1280 * @see ModelElementFacade#isReservedWord()
1281 */
1282 public boolean isReservedWord()
1283 {
1284 return this.getSuperManageableEntityAttribute().isReservedWord();
1285 }
1286
1287 /**
1288 * True is there are template parameters on this model element. For UML2, applies to Class,
1289 * Operation, Property, and Parameter.
1290 * @see ModelElementFacade#isTemplateParametersPresent()
1291 */
1292 public boolean isTemplateParametersPresent()
1293 {
1294 return this.getSuperManageableEntityAttribute().isTemplateParametersPresent();
1295 }
1296
1297 /**
1298 * True if this element name is a valid identifier name in Java, C#, ANSI or ISO C, C++,
1299 * JavaScript. Contains no spaces, special characters etc. Constraint always applied on
1300 * Enumerations and Interfaces, optionally applies on other model elements.
1301 * @see ModelElementFacade#isValidIdentifierName()
1302 */
1303 public boolean isValidIdentifierName()
1304 {
1305 return this.getSuperManageableEntityAttribute().isValidIdentifierName();
1306 }
1307
1308 /**
1309 * Searches for the constraint with the specified 'name' on this model element, and if found
1310 * translates it using the specified 'translation' from a translation library discovered by the
1311 * framework.
1312 * @see ModelElementFacade#translateConstraint(String name, String translation)
1313 */
1314 public String translateConstraint(String name, String translation)
1315 {
1316 return this.getSuperManageableEntityAttribute().translateConstraint(name, translation);
1317 }
1318
1319 /**
1320 * Translates all constraints belonging to this model element with the given 'translation'.
1321 * @see ModelElementFacade#translateConstraints(String translation)
1322 */
1323 public String[] translateConstraints(String translation)
1324 {
1325 return this.getSuperManageableEntityAttribute().translateConstraints(translation);
1326 }
1327
1328 /**
1329 * Translates the constraints of the specified 'kind' belonging to this model element.
1330 * @see ModelElementFacade#translateConstraints(String kind, String translation)
1331 */
1332 public String[] translateConstraints(String kind, String translation)
1333 {
1334 return this.getSuperManageableEntityAttribute().translateConstraints(kind, translation);
1335 }
1336
1337 /**
1338 * @see MetafacadeBase#initialize()
1339 */
1340 @Override
1341 public void initialize()
1342 {
1343 this.getSuperManageableEntityAttribute().initialize();
1344 }
1345
1346 /**
1347 * @return Object getSuperManageableEntityAttribute().getValidationOwner()
1348 * @see MetafacadeBase#getValidationOwner()
1349 */
1350 @Override
1351 public Object getValidationOwner()
1352 {
1353 Object owner = this.getSuperManageableEntityAttribute().getValidationOwner();
1354 return owner;
1355 }
1356
1357 /**
1358 * @return String getSuperManageableEntityAttribute().getValidationName()
1359 * @see MetafacadeBase#getValidationName()
1360 */
1361 @Override
1362 public String getValidationName()
1363 {
1364 String name = this.getSuperManageableEntityAttribute().getValidationName();
1365 return name;
1366 }
1367
1368 /**
1369 * <p><b>Constraint:</b> org::andromda::cartridges::bpm4struts::metafacades::StrutsManageableEntityAttribute::required fields may not be hidden</p>
1370 * <p><b>Error:</b> Required fields may not be hidden, unless they are auto-generated identifiers.</p>
1371 * <p><b>OCL:</b> context StrutsManageableEntityAttribute inv:
1372 (required and not (identifier and owner.dynamicIdentifiersPresent)) implies not hidden</p>
1373 * <p><b>Constraint:</b> org::andromda::cartridges::bpm4struts::metafacades::StrutsManageableEntityAttribute::widget type cannot be arbitrary</p>
1374 * <p><b>Error:</b> Only text, textarea and hidden widgets are supported, please select another one or let the cartridge decide by not specifying anything.</p>
1375 * <p><b>OCL:</b> context StrutsManageableEntityAttribute inv: widgetType->notEmpty() implies
1376 (widgetType = 'text' or widgetType = 'textarea' or widgetType = 'hidden')</p>
1377 * <p><b>Constraint:</b> org::andromda::cartridges::bpm4struts::metafacades::StrutsManageableEntityAttribute::SAFE NAME - TO BE REMOVED LATER</p>
1378 * <p><b>Error:</b> The names you give to fields cannot start with a lowercase character directly followed by a character in uppercase. This is due to a bug in the Jakarta commons library which is used by Struts. The behavior of that library is inconsistent with the reflection API provided by the JDK. Please rename this field or you'll get exceptions when running your web application.</p>
1379 * <p><b>OCL:</b> context StrutsAttribute inv: safeNamePresent</p>
1380 * @param validationMessages Collection<ModelValidationMessage>
1381 * @see MetafacadeBase#validateInvariants(Collection validationMessages)
1382 */
1383 @Override
1384 public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
1385 {
1386 this.getSuperManageableEntityAttribute().validateInvariants(validationMessages);
1387 try
1388 {
1389 final Object contextElement = this.THIS();
1390 boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf((Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"required"))).booleanValue()&&!(Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"identifier"))).booleanValue()&&Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"owner.dynamicIdentifiersPresent"))).booleanValue())))).booleanValue()?Boolean.valueOf(String.valueOf(!Boolean.valueOf(String.valueOf(OCLIntrospector.invoke(contextElement,"hidden"))).booleanValue())).booleanValue():true));
1391 if (!constraintValid)
1392 {
1393 validationMessages.add(
1394 new ModelValidationMessage(
1395 (MetafacadeBase)contextElement ,
1396 "org::andromda::cartridges::bpm4struts::metafacades::StrutsManageableEntityAttribute::required fields may not be hidden",
1397 "Required fields may not be hidden, unless they are auto-generated identifiers."));
1398 }
1399 }
1400 catch (Throwable th)
1401 {
1402 Throwable cause = th.getCause();
1403 int depth = 0; // Some throwables have infinite recursion
1404 while (cause != null && depth < 7)
1405 {
1406 th = cause;
1407 depth++;
1408 }
1409 logger.error("Error validating constraint 'org::andromda::cartridges::bpm4struts::metafacades::StrutsManageableEntityAttribute::required fields may not be hidden' ON "
1410 + this.THIS().toString() + ": " + th.getMessage(), th);
1411 }
1412 try
1413 {
1414 final Object contextElement = this.THIS();
1415 boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(OCLCollections.notEmpty(OCLIntrospector.invoke(contextElement,"widgetType")))).booleanValue()?(OCLExpressions.equal(OCLIntrospector.invoke(contextElement,"widgetType"),"text")||OCLExpressions.equal(OCLIntrospector.invoke(contextElement,"widgetType"),"textarea")||OCLExpressions.equal(OCLIntrospector.invoke(contextElement,"widgetType"),"hidden")):true));
1416 if (!constraintValid)
1417 {
1418 validationMessages.add(
1419 new ModelValidationMessage(
1420 (MetafacadeBase)contextElement ,
1421 "org::andromda::cartridges::bpm4struts::metafacades::StrutsManageableEntityAttribute::widget type cannot be arbitrary",
1422 "Only text, textarea and hidden widgets are supported, please select another one or let the cartridge decide by not specifying anything."));
1423 }
1424 }
1425 catch (Throwable th)
1426 {
1427 Throwable cause = th.getCause();
1428 int depth = 0; // Some throwables have infinite recursion
1429 while (cause != null && depth < 7)
1430 {
1431 th = cause;
1432 depth++;
1433 }
1434 logger.error("Error validating constraint 'org::andromda::cartridges::bpm4struts::metafacades::StrutsManageableEntityAttribute::widget type cannot be arbitrary' ON "
1435 + this.THIS().toString() + ": " + th.getMessage(), th);
1436 }
1437 try
1438 {
1439 final Object contextElement = this.THIS();
1440 boolean constraintValid = OCLResultEnsurer.ensure(OCLIntrospector.invoke(contextElement,"safeNamePresent"));
1441 if (!constraintValid)
1442 {
1443 validationMessages.add(
1444 new ModelValidationMessage(
1445 (MetafacadeBase)contextElement ,
1446 "org::andromda::cartridges::bpm4struts::metafacades::StrutsManageableEntityAttribute::SAFE NAME - TO BE REMOVED LATER",
1447 "The names you give to fields cannot start with a lowercase character directly followed by a character in uppercase. This is due to a bug in the Jakarta commons library which is used by Struts. The behavior of that library is inconsistent with the reflection API provided by the JDK. Please rename this field or you'll get exceptions when running your web application."));
1448 }
1449 }
1450 catch (Throwable th)
1451 {
1452 Throwable cause = th.getCause();
1453 int depth = 0; // Some throwables have infinite recursion
1454 while (cause != null && depth < 7)
1455 {
1456 th = cause;
1457 depth++;
1458 }
1459 logger.error("Error validating constraint 'org::andromda::cartridges::bpm4struts::metafacades::StrutsManageableEntityAttribute::SAFE NAME - TO BE REMOVED LATER' ON "
1460 + this.THIS().toString() + ": " + th.getMessage(), th);
1461 }
1462 }
1463
1464 /**
1465 * The property that stores the name of the metafacade.
1466 */
1467 private static final String NAME_PROPERTY = "name";
1468 private static final String FQNAME_PROPERTY = "fullyQualifiedName";
1469
1470 /**
1471 * @see Object#toString()
1472 */
1473 @Override
1474 public String toString()
1475 {
1476 final StringBuilder toString = new StringBuilder(this.getClass().getName());
1477 toString.append("[");
1478 try
1479 {
1480 toString.append(Introspector.instance().getProperty(this, FQNAME_PROPERTY));
1481 }
1482 catch (final Throwable tryAgain)
1483 {
1484 try
1485 {
1486 toString.append(Introspector.instance().getProperty(this, NAME_PROPERTY));
1487 }
1488 catch (final Throwable ignore)
1489 {
1490 // - just ignore when the metafacade doesn't have a name or fullyQualifiedName property
1491 }
1492 }
1493 toString.append("]");
1494 return toString.toString();
1495 }
1496 }