1
2
3
4 package org.andromda.cartridges.webservice.metafacades;
5
6 /***
7 * MetafacadeLogic for org.andromda.cartridges.webservice.metafacades.WebServiceParameter
8 *
9 * @see org.andromda.cartridges.webservice.metafacades.WebServiceParameter
10 */
11 public abstract class WebServiceParameterLogic
12 extends org.andromda.core.metafacade.MetafacadeBase
13 implements org.andromda.cartridges.webservice.metafacades.WebServiceParameter
14 {
15
16 protected Object metaObject;
17
18 public WebServiceParameterLogic(Object metaObject, String context)
19 {
20 super(metaObject, getContext(context));
21 this.superParameterFacade =
22 (org.andromda.metafacades.uml.ParameterFacade)
23 org.andromda.core.metafacade.MetafacadeFactory.getInstance().createFacadeImpl(
24 "org.andromda.metafacades.uml.ParameterFacade",
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.webservice.metafacades.WebServiceParameter";
38 }
39 return context;
40 }
41
42 private org.andromda.metafacades.uml.ParameterFacade superParameterFacade;
43 private boolean superParameterFacadeInitialized = false;
44
45 /***
46 * Gets the org.andromda.metafacades.uml.ParameterFacade parent instance.
47 */
48 private org.andromda.metafacades.uml.ParameterFacade getSuperParameterFacade()
49 {
50 if (!this.superParameterFacadeInitialized)
51 {
52 ((org.andromda.core.metafacade.MetafacadeBase)superParameterFacade).setMetafacadeContext(this.getMetafacadeContext());
53 this.superParameterFacadeInitialized = true;
54 }
55 return superParameterFacade;
56 }
57
58 /***
59 * @see org.andromda.core.metafacade.MetafacadeBase
60 */
61 public void resetMetafacadeContext(String context)
62 {
63 if (!this.contextRoot)
64 {
65 context = getContext(context);
66 setMetafacadeContext (context);
67 if (this.superParameterFacadeInitialized)
68 {
69 ((org.andromda.core.metafacade.MetafacadeBase)superParameterFacade).resetMetafacadeContext(context);
70 }
71 }
72 }
73
74 /***
75 * @see org.andromda.cartridges.webservice.metafacades.WebServiceParameter
76 */
77 public boolean isWebServiceParameterMetaType()
78 {
79 return true;
80 }
81
82
83
84 /***
85 * @see org.andromda.cartridges.webservice.metafacades.WebServiceParameter#isNillable()
86 */
87 protected abstract boolean handleIsNillable();
88
89 private void handleIsNillable1aPreCondition()
90 {
91 }
92
93 private void handleIsNillable1aPostCondition()
94 {
95 }
96
97 private boolean __nillable1a;
98 private boolean __nillable1aSet = false;
99
100 public final boolean isNillable()
101 {
102 boolean nillable1a = this.__nillable1a;
103 if (!this.__nillable1aSet)
104 {
105 handleIsNillable1aPreCondition();
106 nillable1a = handleIsNillable();
107 handleIsNillable1aPostCondition();
108 this.__nillable1a = nillable1a;
109 if (isMetafacadePropertyCachingEnabled())
110 {
111 this.__nillable1aSet = true;
112 }
113 }
114 return nillable1a;
115 }
116
117 /***
118 * @see org.andromda.cartridges.webservice.metafacades.WebServiceParameter#getTestTypeName()
119 */
120 protected abstract java.lang.String handleGetTestTypeName();
121
122 private void handleGetTestTypeName2aPreCondition()
123 {
124 }
125
126 private void handleGetTestTypeName2aPostCondition()
127 {
128 }
129
130 private java.lang.String __testTypeName2a;
131 private boolean __testTypeName2aSet = false;
132
133 public final java.lang.String getTestTypeName()
134 {
135 java.lang.String testTypeName2a = this.__testTypeName2a;
136 if (!this.__testTypeName2aSet)
137 {
138 handleGetTestTypeName2aPreCondition();
139 testTypeName2a = handleGetTestTypeName();
140 handleGetTestTypeName2aPostCondition();
141 this.__testTypeName2a = testTypeName2a;
142 if (isMetafacadePropertyCachingEnabled())
143 {
144 this.__testTypeName2aSet = true;
145 }
146 }
147 return testTypeName2a;
148 }
149
150 /***
151 * @see org.andromda.metafacades.uml.ParameterFacade
152 */
153 public boolean isParameterFacadeMetaType()
154 {
155 return true;
156 }
157
158 /***
159 * @see org.andromda.metafacades.uml.ModelElementFacade
160 */
161 public boolean isModelElementFacadeMetaType()
162 {
163 return true;
164 }
165
166
167
168 public void copyTaggedValues(org.andromda.metafacades.uml.ModelElementFacade element)
169 {
170 this.getSuperParameterFacade().copyTaggedValues(element);
171 }
172
173
174 public java.lang.Object findTaggedValue(java.lang.String tagName)
175 {
176 return this.getSuperParameterFacade().findTaggedValue(tagName);
177 }
178
179
180 public java.util.Collection findTaggedValues(java.lang.String tagName)
181 {
182 return this.getSuperParameterFacade().findTaggedValues(tagName);
183 }
184
185
186 public java.util.Collection getConstraints()
187 {
188 return this.getSuperParameterFacade().getConstraints();
189 }
190
191
192 public java.util.Collection getConstraints(java.lang.String kind)
193 {
194 return this.getSuperParameterFacade().getConstraints(kind);
195 }
196
197
198 public java.lang.String getDocumentation(java.lang.String indent, int lineLength)
199 {
200 return this.getSuperParameterFacade().getDocumentation(indent, lineLength);
201 }
202
203
204 public java.lang.String getDocumentation(java.lang.String indent, int lineLength, boolean htmlStyle)
205 {
206 return this.getSuperParameterFacade().getDocumentation(indent, lineLength, htmlStyle);
207 }
208
209
210 public java.lang.String getDocumentation(java.lang.String indent)
211 {
212 return this.getSuperParameterFacade().getDocumentation(indent);
213 }
214
215
216 public java.lang.String getFullyQualifiedName(boolean modelName)
217 {
218 return this.getSuperParameterFacade().getFullyQualifiedName(modelName);
219 }
220
221
222 public java.lang.String getFullyQualifiedName()
223 {
224 return this.getSuperParameterFacade().getFullyQualifiedName();
225 }
226
227
228 public java.lang.String getFullyQualifiedNamePath()
229 {
230 return this.getSuperParameterFacade().getFullyQualifiedNamePath();
231 }
232
233
234 public java.lang.String getId()
235 {
236 return this.getSuperParameterFacade().getId();
237 }
238
239
240 public org.andromda.metafacades.uml.TypeMappings getLanguageMappings()
241 {
242 return this.getSuperParameterFacade().getLanguageMappings();
243 }
244
245
246 public org.andromda.metafacades.uml.ModelFacade getModel()
247 {
248 return this.getSuperParameterFacade().getModel();
249 }
250
251
252 public java.lang.String getName()
253 {
254 return this.getSuperParameterFacade().getName();
255 }
256
257
258 public org.andromda.metafacades.uml.ModelElementFacade getPackage()
259 {
260 return this.getSuperParameterFacade().getPackage();
261 }
262
263
264 public java.lang.String getPackageName(boolean modelName)
265 {
266 return this.getSuperParameterFacade().getPackageName(modelName);
267 }
268
269
270 public java.lang.String getPackageName()
271 {
272 return this.getSuperParameterFacade().getPackageName();
273 }
274
275
276 public java.lang.String getPackagePath()
277 {
278 return this.getSuperParameterFacade().getPackagePath();
279 }
280
281
282 public org.andromda.metafacades.uml.PackageFacade getRootPackage()
283 {
284 return this.getSuperParameterFacade().getRootPackage();
285 }
286
287
288 public java.util.Collection getSourceDependencies()
289 {
290 return this.getSuperParameterFacade().getSourceDependencies();
291 }
292
293
294 public org.andromda.metafacades.uml.StateMachineFacade getStateMachineContext()
295 {
296 return this.getSuperParameterFacade().getStateMachineContext();
297 }
298
299
300 public java.util.Collection getStereotypeNames()
301 {
302 return this.getSuperParameterFacade().getStereotypeNames();
303 }
304
305
306 public java.util.Collection getStereotypes()
307 {
308 return this.getSuperParameterFacade().getStereotypes();
309 }
310
311
312 public java.util.Collection getTaggedValues()
313 {
314 return this.getSuperParameterFacade().getTaggedValues();
315 }
316
317
318 public java.util.Collection getTargetDependencies()
319 {
320 return this.getSuperParameterFacade().getTargetDependencies();
321 }
322
323
324 public java.lang.Object getTemplateParameter(java.lang.String parameterName)
325 {
326 return this.getSuperParameterFacade().getTemplateParameter(parameterName);
327 }
328
329
330 public java.util.Collection getTemplateParameters()
331 {
332 return this.getSuperParameterFacade().getTemplateParameters();
333 }
334
335
336 public java.lang.String getVisibility()
337 {
338 return this.getSuperParameterFacade().getVisibility();
339 }
340
341
342 public boolean hasExactStereotype(java.lang.String stereotypeName)
343 {
344 return this.getSuperParameterFacade().hasExactStereotype(stereotypeName);
345 }
346
347
348 public boolean hasStereotype(java.lang.String stereotypeName)
349 {
350 return this.getSuperParameterFacade().hasStereotype(stereotypeName);
351 }
352
353
354 public boolean isBindingDependenciesPresent()
355 {
356 return this.getSuperParameterFacade().isBindingDependenciesPresent();
357 }
358
359
360 public boolean isConstraintsPresent()
361 {
362 return this.getSuperParameterFacade().isConstraintsPresent();
363 }
364
365
366 public boolean isTemplateParametersPresent()
367 {
368 return this.getSuperParameterFacade().isTemplateParametersPresent();
369 }
370
371
372 public java.lang.String translateConstraint(java.lang.String name, java.lang.String translation)
373 {
374 return this.getSuperParameterFacade().translateConstraint(name, translation);
375 }
376
377
378 public java.lang.String[] translateConstraints(java.lang.String translation)
379 {
380 return this.getSuperParameterFacade().translateConstraints(translation);
381 }
382
383
384 public java.lang.String[] translateConstraints(java.lang.String kind, java.lang.String translation)
385 {
386 return this.getSuperParameterFacade().translateConstraints(kind, translation);
387 }
388
389
390 public java.lang.String getDefaultValue()
391 {
392 return this.getSuperParameterFacade().getDefaultValue();
393 }
394
395
396 public org.andromda.metafacades.uml.EventFacade getEvent()
397 {
398 return this.getSuperParameterFacade().getEvent();
399 }
400
401
402 public java.lang.String getGetterName()
403 {
404 return this.getSuperParameterFacade().getGetterName();
405 }
406
407
408 public int getLower()
409 {
410 return this.getSuperParameterFacade().getLower();
411 }
412
413
414 public org.andromda.metafacades.uml.OperationFacade getOperation()
415 {
416 return this.getSuperParameterFacade().getOperation();
417 }
418
419
420 public java.lang.String getSetterName()
421 {
422 return this.getSuperParameterFacade().getSetterName();
423 }
424
425
426 public org.andromda.metafacades.uml.ClassifierFacade getType()
427 {
428 return this.getSuperParameterFacade().getType();
429 }
430
431
432 public int getUpper()
433 {
434 return this.getSuperParameterFacade().getUpper();
435 }
436
437
438 public boolean isDefaultValuePresent()
439 {
440 return this.getSuperParameterFacade().isDefaultValuePresent();
441 }
442
443
444 public boolean isInParameter()
445 {
446 return this.getSuperParameterFacade().isInParameter();
447 }
448
449
450 public boolean isInoutParameter()
451 {
452 return this.getSuperParameterFacade().isInoutParameter();
453 }
454
455
456 public boolean isOutParameter()
457 {
458 return this.getSuperParameterFacade().isOutParameter();
459 }
460
461
462 public boolean isReadable()
463 {
464 return this.getSuperParameterFacade().isReadable();
465 }
466
467
468 public boolean isRequired()
469 {
470 return this.getSuperParameterFacade().isRequired();
471 }
472
473
474 public boolean isReturn()
475 {
476 return this.getSuperParameterFacade().isReturn();
477 }
478
479
480 public boolean isWritable()
481 {
482 return this.getSuperParameterFacade().isWritable();
483 }
484
485 /***
486 * @see org.andromda.core.metafacade.MetafacadeBase#initialize()
487 */
488 public void initialize()
489 {
490 this.getSuperParameterFacade().initialize();
491 }
492
493 /***
494 * @see org.andromda.core.metafacade.MetafacadeBase#getValidationOwner()
495 */
496 public Object getValidationOwner()
497 {
498 Object owner = this.getSuperParameterFacade().getValidationOwner();
499 return owner;
500 }
501
502 /***
503 * @see org.andromda.core.metafacade.MetafacadeBase#getValidationName()
504 */
505 public String getValidationName()
506 {
507 String name = this.getSuperParameterFacade().getValidationName();
508 return name;
509 }
510
511 /***
512 * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(java.util.Collection)
513 */
514 public void validateInvariants(java.util.Collection validationMessages)
515 {
516 this.getSuperParameterFacade().validateInvariants(validationMessages);
517 {
518 final java.lang.Object contextElement = this.THIS(); boolean constraintValid = org.andromda.translation.ocl.validation.OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(org.andromda.translation.ocl.validation.OCLExpressions.equal(org.andromda.translation.ocl.validation.OCLIntrospector.invoke(contextElement,"return"),false))).booleanValue()?org.andromda.translation.ocl.validation.OCLExpressions.equal(org.andromda.translation.ocl.validation.OCLIntrospector.invoke(contextElement,"type.collectionType"),false):true));
519 if (!constraintValid)
520 validationMessages.add(
521 new org.andromda.core.metafacade.ModelValidationMessage(
522 (org.andromda.core.metafacade.MetafacadeBase)contextElement ,
523 "org::andromda::cartridges::webservice::metafacades::WebServiceParameter::a web service parameter can not be of type collection",
524 "A web service parameter can NOT be a collection type You'll need to model an array instead."));
525 }
526 }
527
528 /***
529 * The property that stores the name of the metafacade.
530 */
531 private static final String NAME_PROPERTY = "name";
532
533 /***
534 * @see java.lang.Object#toString()
535 */
536 public String toString()
537 {
538 final StringBuffer toString = new StringBuffer(this.getClass().getName());
539 toString.append("[");
540 try
541 {
542 toString.append(org.andromda.core.common.Introspector.instance().getProperty(this, NAME_PROPERTY));
543 }
544 catch (final Throwable throwable)
545 {
546
547 }
548 toString.append("]");
549 return toString.toString();
550 }
551 }