View Javadoc

1   //
2   // Attention: generated code (by MetafacadeLogic.vsl) - do not modify!
3   //
4   package org.andromda.cartridges.bpm4struts.metafacades;
5   
6   /***
7    * MetafacadeLogic for org.andromda.cartridges.bpm4struts.metafacades.StrutsAttribute
8    *
9    * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsAttribute
10   */
11  public abstract class StrutsAttributeLogic
12      extends org.andromda.core.metafacade.MetafacadeBase
13      implements org.andromda.cartridges.bpm4struts.metafacades.StrutsAttribute
14  {
15  
16      protected Object metaObject;
17  
18      public StrutsAttributeLogic(Object metaObject, String context)
19      {
20          super(metaObject, getContext(context));
21          this.superAttributeFacade =
22             (org.andromda.metafacades.uml.AttributeFacade)
23              org.andromda.core.metafacade.MetafacadeFactory.getInstance().createFacadeImpl(
24                      "org.andromda.metafacades.uml.AttributeFacade",
25                      metaObject,
26                      getContext(context));
27          this.metaObject = metaObject;
28      }
29  
30      /***
31       * Gets the context for this metafacade logic instance.
32       */
33      private static String getContext(String context)
34      {
35          if (context == null)
36          {
37              context = "org.andromda.cartridges.bpm4struts.metafacades.StrutsAttribute";
38          }
39          return context;
40      }
41  
42      private org.andromda.metafacades.uml.AttributeFacade superAttributeFacade;
43      private boolean superAttributeFacadeInitialized = false;
44  
45      /***
46       * Gets the org.andromda.metafacades.uml.AttributeFacade parent instance.
47       */
48      private org.andromda.metafacades.uml.AttributeFacade getSuperAttributeFacade()
49      {
50          if (!this.superAttributeFacadeInitialized)
51          {
52              ((org.andromda.core.metafacade.MetafacadeBase)superAttributeFacade).setMetafacadeContext(this.getMetafacadeContext());
53              this.superAttributeFacadeInitialized = true;
54          }
55          return superAttributeFacade;
56      }
57  
58      /***
59       * @see org.andromda.core.metafacade.MetafacadeBase
60       */
61      public void resetMetafacadeContext(String context)
62      {
63          if (!this.contextRoot) // reset context only for non-root metafacades
64          {
65              context = getContext(context);  // to have same value as in original constructor call
66              setMetafacadeContext (context);
67              if (this.superAttributeFacadeInitialized)
68              {
69                  ((org.andromda.core.metafacade.MetafacadeBase)superAttributeFacade).resetMetafacadeContext(context);
70              }
71          }
72      }
73  
74      /***
75       * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsAttribute
76       */
77      public boolean isStrutsAttributeMetaType()
78      {
79          return true;
80      }
81      
82      // --------------- attributes ---------------------
83  
84     /***
85      * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsAttribute#getDateFormat()
86      */
87      protected abstract java.lang.String handleGetDateFormat();
88  
89      private void handleGetDateFormat1aPreCondition()
90      {
91      }
92  
93      private void handleGetDateFormat1aPostCondition()
94      {
95      }
96  
97      private java.lang.String __dateFormat1a;
98      private boolean __dateFormat1aSet = false;
99  
100     public final java.lang.String getDateFormat()
101     {
102         java.lang.String dateFormat1a = this.__dateFormat1a;
103         if (!this.__dateFormat1aSet)
104         {
105             handleGetDateFormat1aPreCondition();
106             dateFormat1a = handleGetDateFormat();
107             handleGetDateFormat1aPostCondition();
108             this.__dateFormat1a = dateFormat1a;
109             if (isMetafacadePropertyCachingEnabled())
110             {
111                 this.__dateFormat1aSet = true;
112             }
113         }
114         return dateFormat1a;
115     }
116 
117    /***
118     * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsAttribute#isSafeNamePresent()
119     */
120     protected abstract boolean handleIsSafeNamePresent();
121 
122     private void handleIsSafeNamePresent2aPreCondition()
123     {
124     }
125 
126     private void handleIsSafeNamePresent2aPostCondition()
127     {
128     }
129 
130     private boolean __safeNamePresent2a;
131     private boolean __safeNamePresent2aSet = false;
132 
133     public final boolean isSafeNamePresent()
134     {
135         boolean safeNamePresent2a = this.__safeNamePresent2a;
136         if (!this.__safeNamePresent2aSet)
137         {
138             handleIsSafeNamePresent2aPreCondition();
139             safeNamePresent2a = handleIsSafeNamePresent();
140             handleIsSafeNamePresent2aPostCondition();
141             this.__safeNamePresent2a = safeNamePresent2a;
142             if (isMetafacadePropertyCachingEnabled())
143             {
144                 this.__safeNamePresent2aSet = true;
145             }
146         }
147         return safeNamePresent2a;
148     }
149 
150     // ---------------- business methods ----------------------
151 
152     protected abstract java.lang.String handleGetDummyValue(int seed);
153 
154     private void handleGetDummyValue1oPreCondition()
155     {
156     }
157 
158     private void handleGetDummyValue1oPostCondition()
159     {
160     }
161 
162     public java.lang.String getDummyValue(int seed)
163     {
164         handleGetDummyValue1oPreCondition();
165         java.lang.String returnValue = handleGetDummyValue(seed);
166         handleGetDummyValue1oPostCondition();
167         return returnValue;
168     }
169 
170     /***
171      * @see org.andromda.metafacades.uml.AttributeFacade
172      */
173     public boolean isAttributeFacadeMetaType()
174     {
175         return true;
176     }
177     
178     /***
179      * @see org.andromda.metafacades.uml.ModelElementFacade
180      */
181     public boolean isModelElementFacadeMetaType()
182     {
183         return true;
184     }
185     
186     // ----------- delegates to org.andromda.metafacades.uml.AttributeFacade ------------
187     // from org.andromda.metafacades.uml.AttributeFacade
188     public java.lang.Object findTaggedValue(java.lang.String name, boolean follow)
189     {
190         return this.getSuperAttributeFacade().findTaggedValue(name, follow);
191     }
192 
193     // from org.andromda.metafacades.uml.AttributeFacade
194     public java.lang.String getDefaultValue()
195     {
196         return this.getSuperAttributeFacade().getDefaultValue();
197     }
198 
199     // from org.andromda.metafacades.uml.AttributeFacade
200     public org.andromda.metafacades.uml.EnumerationFacade getEnumeration()
201     {
202         return this.getSuperAttributeFacade().getEnumeration();
203     }
204 
205     // from org.andromda.metafacades.uml.AttributeFacade
206     public java.lang.String getEnumerationLiteralParameters()
207     {
208         return this.getSuperAttributeFacade().getEnumerationLiteralParameters();
209     }
210 
211     // from org.andromda.metafacades.uml.AttributeFacade
212     public java.lang.String getEnumerationValue()
213     {
214         return this.getSuperAttributeFacade().getEnumerationValue();
215     }
216 
217     // from org.andromda.metafacades.uml.AttributeFacade
218     public java.lang.String getGetterName()
219     {
220         return this.getSuperAttributeFacade().getGetterName();
221     }
222 
223     // from org.andromda.metafacades.uml.AttributeFacade
224     public java.lang.String getGetterSetterTypeName()
225     {
226         return this.getSuperAttributeFacade().getGetterSetterTypeName();
227     }
228 
229     // from org.andromda.metafacades.uml.AttributeFacade
230     public int getLower()
231     {
232         return this.getSuperAttributeFacade().getLower();
233     }
234 
235     // from org.andromda.metafacades.uml.AttributeFacade
236     public org.andromda.metafacades.uml.ClassifierFacade getOwner()
237     {
238         return this.getSuperAttributeFacade().getOwner();
239     }
240 
241     // from org.andromda.metafacades.uml.AttributeFacade
242     public java.lang.String getSetterName()
243     {
244         return this.getSuperAttributeFacade().getSetterName();
245     }
246 
247     // from org.andromda.metafacades.uml.AttributeFacade
248     public org.andromda.metafacades.uml.ClassifierFacade getType()
249     {
250         return this.getSuperAttributeFacade().getType();
251     }
252 
253     // from org.andromda.metafacades.uml.AttributeFacade
254     public int getUpper()
255     {
256         return this.getSuperAttributeFacade().getUpper();
257     }
258 
259     // from org.andromda.metafacades.uml.AttributeFacade
260     public boolean isAddOnly()
261     {
262         return this.getSuperAttributeFacade().isAddOnly();
263     }
264 
265     // from org.andromda.metafacades.uml.AttributeFacade
266     public boolean isChangeable()
267     {
268         return this.getSuperAttributeFacade().isChangeable();
269     }
270 
271     // from org.andromda.metafacades.uml.AttributeFacade
272     public boolean isDefaultValuePresent()
273     {
274         return this.getSuperAttributeFacade().isDefaultValuePresent();
275     }
276 
277     // from org.andromda.metafacades.uml.AttributeFacade
278     public boolean isEnumerationLiteral()
279     {
280         return this.getSuperAttributeFacade().isEnumerationLiteral();
281     }
282 
283     // from org.andromda.metafacades.uml.AttributeFacade
284     public boolean isEnumerationLiteralParametersExist()
285     {
286         return this.getSuperAttributeFacade().isEnumerationLiteralParametersExist();
287     }
288 
289     // from org.andromda.metafacades.uml.AttributeFacade
290     public boolean isEnumerationMember()
291     {
292         return this.getSuperAttributeFacade().isEnumerationMember();
293     }
294 
295     // from org.andromda.metafacades.uml.AttributeFacade
296     public boolean isMany()
297     {
298         return this.getSuperAttributeFacade().isMany();
299     }
300 
301     // from org.andromda.metafacades.uml.AttributeFacade
302     public boolean isOrdered()
303     {
304         return this.getSuperAttributeFacade().isOrdered();
305     }
306 
307     // from org.andromda.metafacades.uml.AttributeFacade
308     public boolean isReadOnly()
309     {
310         return this.getSuperAttributeFacade().isReadOnly();
311     }
312 
313     // from org.andromda.metafacades.uml.AttributeFacade
314     public boolean isRequired()
315     {
316         return this.getSuperAttributeFacade().isRequired();
317     }
318 
319     // from org.andromda.metafacades.uml.AttributeFacade
320     public boolean isStatic()
321     {
322         return this.getSuperAttributeFacade().isStatic();
323     }
324 
325     // from org.andromda.metafacades.uml.ModelElementFacade
326     public void copyTaggedValues(org.andromda.metafacades.uml.ModelElementFacade element)
327     {
328         this.getSuperAttributeFacade().copyTaggedValues(element);
329     }
330 
331     // from org.andromda.metafacades.uml.ModelElementFacade
332     public java.lang.Object findTaggedValue(java.lang.String tagName)
333     {
334         return this.getSuperAttributeFacade().findTaggedValue(tagName);
335     }
336 
337     // from org.andromda.metafacades.uml.ModelElementFacade
338     public java.util.Collection findTaggedValues(java.lang.String tagName)
339     {
340         return this.getSuperAttributeFacade().findTaggedValues(tagName);
341     }
342 
343     // from org.andromda.metafacades.uml.ModelElementFacade
344     public java.util.Collection getConstraints()
345     {
346         return this.getSuperAttributeFacade().getConstraints();
347     }
348 
349     // from org.andromda.metafacades.uml.ModelElementFacade
350     public java.util.Collection getConstraints(java.lang.String kind)
351     {
352         return this.getSuperAttributeFacade().getConstraints(kind);
353     }
354 
355     // from org.andromda.metafacades.uml.ModelElementFacade
356     public java.lang.String getDocumentation(java.lang.String indent, int lineLength)
357     {
358         return this.getSuperAttributeFacade().getDocumentation(indent, lineLength);
359     }
360 
361     // from org.andromda.metafacades.uml.ModelElementFacade
362     public java.lang.String getDocumentation(java.lang.String indent, int lineLength, boolean htmlStyle)
363     {
364         return this.getSuperAttributeFacade().getDocumentation(indent, lineLength, htmlStyle);
365     }
366 
367     // from org.andromda.metafacades.uml.ModelElementFacade
368     public java.lang.String getDocumentation(java.lang.String indent)
369     {
370         return this.getSuperAttributeFacade().getDocumentation(indent);
371     }
372 
373     // from org.andromda.metafacades.uml.ModelElementFacade
374     public java.lang.String getFullyQualifiedName(boolean modelName)
375     {
376         return this.getSuperAttributeFacade().getFullyQualifiedName(modelName);
377     }
378 
379     // from org.andromda.metafacades.uml.ModelElementFacade
380     public java.lang.String getFullyQualifiedName()
381     {
382         return this.getSuperAttributeFacade().getFullyQualifiedName();
383     }
384 
385     // from org.andromda.metafacades.uml.ModelElementFacade
386     public java.lang.String getFullyQualifiedNamePath()
387     {
388         return this.getSuperAttributeFacade().getFullyQualifiedNamePath();
389     }
390 
391     // from org.andromda.metafacades.uml.ModelElementFacade
392     public java.lang.String getId()
393     {
394         return this.getSuperAttributeFacade().getId();
395     }
396 
397     // from org.andromda.metafacades.uml.ModelElementFacade
398     public org.andromda.metafacades.uml.TypeMappings getLanguageMappings()
399     {
400         return this.getSuperAttributeFacade().getLanguageMappings();
401     }
402 
403     // from org.andromda.metafacades.uml.ModelElementFacade
404     public org.andromda.metafacades.uml.ModelFacade getModel()
405     {
406         return this.getSuperAttributeFacade().getModel();
407     }
408 
409     // from org.andromda.metafacades.uml.ModelElementFacade
410     public java.lang.String getName()
411     {
412         return this.getSuperAttributeFacade().getName();
413     }
414 
415     // from org.andromda.metafacades.uml.ModelElementFacade
416     public org.andromda.metafacades.uml.ModelElementFacade getPackage()
417     {
418         return this.getSuperAttributeFacade().getPackage();
419     }
420 
421     // from org.andromda.metafacades.uml.ModelElementFacade
422     public java.lang.String getPackageName(boolean modelName)
423     {
424         return this.getSuperAttributeFacade().getPackageName(modelName);
425     }
426 
427     // from org.andromda.metafacades.uml.ModelElementFacade
428     public java.lang.String getPackageName()
429     {
430         return this.getSuperAttributeFacade().getPackageName();
431     }
432 
433     // from org.andromda.metafacades.uml.ModelElementFacade
434     public java.lang.String getPackagePath()
435     {
436         return this.getSuperAttributeFacade().getPackagePath();
437     }
438 
439     // from org.andromda.metafacades.uml.ModelElementFacade
440     public org.andromda.metafacades.uml.PackageFacade getRootPackage()
441     {
442         return this.getSuperAttributeFacade().getRootPackage();
443     }
444 
445     // from org.andromda.metafacades.uml.ModelElementFacade
446     public java.util.Collection getSourceDependencies()
447     {
448         return this.getSuperAttributeFacade().getSourceDependencies();
449     }
450 
451     // from org.andromda.metafacades.uml.ModelElementFacade
452     public org.andromda.metafacades.uml.StateMachineFacade getStateMachineContext()
453     {
454         return this.getSuperAttributeFacade().getStateMachineContext();
455     }
456 
457     // from org.andromda.metafacades.uml.ModelElementFacade
458     public java.util.Collection getStereotypeNames()
459     {
460         return this.getSuperAttributeFacade().getStereotypeNames();
461     }
462 
463     // from org.andromda.metafacades.uml.ModelElementFacade
464     public java.util.Collection getStereotypes()
465     {
466         return this.getSuperAttributeFacade().getStereotypes();
467     }
468 
469     // from org.andromda.metafacades.uml.ModelElementFacade
470     public java.util.Collection getTaggedValues()
471     {
472         return this.getSuperAttributeFacade().getTaggedValues();
473     }
474 
475     // from org.andromda.metafacades.uml.ModelElementFacade
476     public java.util.Collection getTargetDependencies()
477     {
478         return this.getSuperAttributeFacade().getTargetDependencies();
479     }
480 
481     // from org.andromda.metafacades.uml.ModelElementFacade
482     public java.lang.Object getTemplateParameter(java.lang.String parameterName)
483     {
484         return this.getSuperAttributeFacade().getTemplateParameter(parameterName);
485     }
486 
487     // from org.andromda.metafacades.uml.ModelElementFacade
488     public java.util.Collection getTemplateParameters()
489     {
490         return this.getSuperAttributeFacade().getTemplateParameters();
491     }
492 
493     // from org.andromda.metafacades.uml.ModelElementFacade
494     public java.lang.String getVisibility()
495     {
496         return this.getSuperAttributeFacade().getVisibility();
497     }
498 
499     // from org.andromda.metafacades.uml.ModelElementFacade
500     public boolean hasExactStereotype(java.lang.String stereotypeName)
501     {
502         return this.getSuperAttributeFacade().hasExactStereotype(stereotypeName);
503     }
504 
505     // from org.andromda.metafacades.uml.ModelElementFacade
506     public boolean hasStereotype(java.lang.String stereotypeName)
507     {
508         return this.getSuperAttributeFacade().hasStereotype(stereotypeName);
509     }
510 
511     // from org.andromda.metafacades.uml.ModelElementFacade
512     public boolean isBindingDependenciesPresent()
513     {
514         return this.getSuperAttributeFacade().isBindingDependenciesPresent();
515     }
516 
517     // from org.andromda.metafacades.uml.ModelElementFacade
518     public boolean isConstraintsPresent()
519     {
520         return this.getSuperAttributeFacade().isConstraintsPresent();
521     }
522 
523     // from org.andromda.metafacades.uml.ModelElementFacade
524     public boolean isTemplateParametersPresent()
525     {
526         return this.getSuperAttributeFacade().isTemplateParametersPresent();
527     }
528 
529     // from org.andromda.metafacades.uml.ModelElementFacade
530     public java.lang.String translateConstraint(java.lang.String name, java.lang.String translation)
531     {
532         return this.getSuperAttributeFacade().translateConstraint(name, translation);
533     }
534 
535     // from org.andromda.metafacades.uml.ModelElementFacade
536     public java.lang.String[] translateConstraints(java.lang.String translation)
537     {
538         return this.getSuperAttributeFacade().translateConstraints(translation);
539     }
540 
541     // from org.andromda.metafacades.uml.ModelElementFacade
542     public java.lang.String[] translateConstraints(java.lang.String kind, java.lang.String translation)
543     {
544         return this.getSuperAttributeFacade().translateConstraints(kind, translation);
545     }
546 
547     /***
548      * @see org.andromda.core.metafacade.MetafacadeBase#initialize()
549      */
550     public void initialize()
551     {
552         this.getSuperAttributeFacade().initialize();
553     }
554 
555     /***
556      * @see org.andromda.core.metafacade.MetafacadeBase#getValidationOwner()
557      */
558     public Object getValidationOwner()
559     {
560         Object owner = this.getSuperAttributeFacade().getValidationOwner();
561         return owner;
562     }
563 
564     /***
565      * @see org.andromda.core.metafacade.MetafacadeBase#getValidationName()
566      */
567     public String getValidationName()
568     {
569         String name = this.getSuperAttributeFacade().getValidationName();
570         return name;
571     }
572 
573     /***
574      * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(java.util.Collection)
575      */
576     public void validateInvariants(java.util.Collection validationMessages)
577     {
578         this.getSuperAttributeFacade().validateInvariants(validationMessages);
579         {
580             final java.lang.Object contextElement = this.THIS(); boolean constraintValid = org.andromda.translation.ocl.validation.OCLResultEnsurer.ensure(org.andromda.translation.ocl.validation.OCLIntrospector.invoke(contextElement,"safeNamePresent")); 
581             if (!constraintValid)
582                 validationMessages.add(
583                     new org.andromda.core.metafacade.ModelValidationMessage(
584                         (org.andromda.core.metafacade.MetafacadeBase)contextElement ,
585                         "org::andromda::cartridges::bpm4struts::metafacades::StrutsManageableEntityAssociationEnd::SAFE NAME - TO BE REMOVED LATER",
586                         "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."));
587         }
588     }
589     
590     /***
591      * The property that stores the name of the metafacade.
592      */
593     private static final String NAME_PROPERTY = "name";
594     
595     /***
596      * @see java.lang.Object#toString()
597      */
598     public String toString()
599     {
600         final StringBuffer toString = new StringBuffer(this.getClass().getName());
601         toString.append("[");
602         try
603         {
604             toString.append(org.andromda.core.common.Introspector.instance().getProperty(this, NAME_PROPERTY));
605         }
606         catch (final Throwable throwable)
607         {
608             // - just ignore when the metafacade doesn't have a name property
609         }
610         toString.append("]");
611         return toString.toString();
612     }
613 }