001// license-header java merge-point
002//
003// Attention: generated code (by MetafacadeLogic.vsl) - do not modify!
004//
005package org.andromda.cartridges.webservice.metafacades;
006
007import java.util.Collection;
008import org.andromda.core.common.Introspector;
009import org.andromda.core.metafacade.MetafacadeBase;
010import org.andromda.core.metafacade.MetafacadeFactory;
011import org.andromda.core.metafacade.ModelValidationMessage;
012import org.andromda.metafacades.uml.ClassifierFacade;
013import org.andromda.metafacades.uml.ConstraintFacade;
014import org.andromda.metafacades.uml.DependencyFacade;
015import org.andromda.metafacades.uml.EventFacade;
016import org.andromda.metafacades.uml.ModelElementFacade;
017import org.andromda.metafacades.uml.ModelFacade;
018import org.andromda.metafacades.uml.OperationFacade;
019import org.andromda.metafacades.uml.PackageFacade;
020import org.andromda.metafacades.uml.ParameterFacade;
021import org.andromda.metafacades.uml.StateMachineFacade;
022import org.andromda.metafacades.uml.StereotypeFacade;
023import org.andromda.metafacades.uml.TaggedValueFacade;
024import org.andromda.metafacades.uml.TemplateParameterFacade;
025import org.andromda.metafacades.uml.TypeMappings;
026import org.andromda.translation.ocl.validation.OCLExpressions;
027import org.andromda.translation.ocl.validation.OCLIntrospector;
028import org.andromda.translation.ocl.validation.OCLResultEnsurer;
029import org.apache.log4j.Logger;
030
031/**
032 * Represents a parameter modeled on a webservice.
033 * MetafacadeLogic for WebServiceParameter
034 *
035 * @see WebServiceParameter
036 */
037public abstract class WebServiceParameterLogic
038    extends MetafacadeBase
039    implements WebServiceParameter
040{
041    /**
042     * The underlying UML object
043     * @see Object
044     */
045    protected Object metaObject;
046
047    /** Create Metafacade implementation instance using the MetafacadeFactory from the context
048     * @param metaObjectIn
049     * @param context
050     */
051    protected WebServiceParameterLogic(Object metaObjectIn, String context)
052    {
053        super(metaObjectIn, getContext(context));
054        this.superParameterFacade =
055           (ParameterFacade)
056            MetafacadeFactory.getInstance().createFacadeImpl(
057                    "org.andromda.metafacades.uml.ParameterFacade",
058                    metaObjectIn,
059                    getContext(context));
060        this.metaObject = metaObjectIn;
061    }
062
063    /**
064     * The logger instance.
065     */
066    private static final Logger logger = Logger.getLogger(WebServiceParameterLogic.class);
067
068    /**
069     * Gets the context for this metafacade logic instance.
070     * @param context String. Set to WebServiceParameter if null
071     * @return context String
072     */
073    private static String getContext(String context)
074    {
075        if (context == null)
076        {
077            context = "org.andromda.cartridges.webservice.metafacades.WebServiceParameter";
078        }
079        return context;
080    }
081
082    private ParameterFacade superParameterFacade;
083    private boolean superParameterFacadeInitialized = false;
084
085    /**
086     * Gets the ParameterFacade parent instance.
087     * @return this.superParameterFacade ParameterFacade
088     */
089    private ParameterFacade getSuperParameterFacade()
090    {
091        if (!this.superParameterFacadeInitialized)
092        {
093            ((MetafacadeBase)this.superParameterFacade).setMetafacadeContext(this.getMetafacadeContext());
094            this.superParameterFacadeInitialized = true;
095        }
096        return this.superParameterFacade;
097    }
098
099    /** Reset context only for non-root metafacades
100     * @param context
101     * @see MetafacadeBase#resetMetafacadeContext(String context)
102     */
103    @Override
104    public void resetMetafacadeContext(String context)
105    {
106        if (!this.contextRoot) // reset context only for non-root metafacades
107        {
108            context = getContext(context);  // to have same value as in original constructor call
109            setMetafacadeContext (context);
110            if (this.superParameterFacadeInitialized)
111            {
112                ((MetafacadeBase)this.superParameterFacade).resetMetafacadeContext(context);
113            }
114        }
115    }
116
117    /**
118     * @return boolean true always
119     * @see WebServiceParameter
120     */
121    public boolean isWebServiceParameterMetaType()
122    {
123        return true;
124    }
125
126    // --------------- attributes ---------------------
127
128   /**
129    * @see org.andromda.cartridges.webservice.metafacades.WebServiceParameter#isNillable()
130    * @return boolean
131    */
132    protected abstract boolean handleIsNillable();
133
134    private boolean __nillable1a;
135    private boolean __nillable1aSet = false;
136
137    /**
138     * Whether or not this webservice parameter is nillable.
139     * @return (boolean)handleIsNillable()
140     */
141    public final boolean isNillable()
142    {
143        boolean nillable1a = this.__nillable1a;
144        if (!this.__nillable1aSet)
145        {
146            // nillable has no pre constraints
147            nillable1a = handleIsNillable();
148            // nillable has no post constraints
149            this.__nillable1a = nillable1a;
150            if (isMetafacadePropertyCachingEnabled())
151            {
152                this.__nillable1aSet = true;
153            }
154        }
155        return nillable1a;
156    }
157
158   /**
159    * @see org.andromda.cartridges.webservice.metafacades.WebServiceParameter#getTestTypeName()
160    * @return String
161    */
162    protected abstract String handleGetTestTypeName();
163
164    private String __testTypeName2a;
165    private boolean __testTypeName2aSet = false;
166
167    /**
168     * The type name used when calling web service tests.
169     * @return (String)handleGetTestTypeName()
170     */
171    public final String getTestTypeName()
172    {
173        String testTypeName2a = this.__testTypeName2a;
174        if (!this.__testTypeName2aSet)
175        {
176            // testTypeName has no pre constraints
177            testTypeName2a = handleGetTestTypeName();
178            // testTypeName has no post constraints
179            this.__testTypeName2a = testTypeName2a;
180            if (isMetafacadePropertyCachingEnabled())
181            {
182                this.__testTypeName2aSet = true;
183            }
184        }
185        return testTypeName2a;
186    }
187
188   /**
189    * @see org.andromda.cartridges.webservice.metafacades.WebServiceParameter#isAttribute()
190    * @return boolean
191    */
192    protected abstract boolean handleIsAttribute();
193
194    private boolean __attribute3a;
195    private boolean __attribute3aSet = false;
196
197    /**
198     * Is the parameter an XML attribute?
199     * @return (boolean)handleIsAttribute()
200     */
201    public final boolean isAttribute()
202    {
203        boolean attribute3a = this.__attribute3a;
204        if (!this.__attribute3aSet)
205        {
206            // attribute has no pre constraints
207            attribute3a = handleIsAttribute();
208            // attribute has no post constraints
209            this.__attribute3a = attribute3a;
210            if (isMetafacadePropertyCachingEnabled())
211            {
212                this.__attribute3aSet = true;
213            }
214        }
215        return attribute3a;
216    }
217
218   /**
219    * @see org.andromda.cartridges.webservice.metafacades.WebServiceParameter#isElement()
220    * @return boolean
221    */
222    protected abstract boolean handleIsElement();
223
224    private boolean __element4a;
225    private boolean __element4aSet = false;
226
227    /**
228     * Is the attribute an XML element?
229     * @return (boolean)handleIsElement()
230     */
231    public final boolean isElement()
232    {
233        boolean element4a = this.__element4a;
234        if (!this.__element4aSet)
235        {
236            // element has no pre constraints
237            element4a = handleIsElement();
238            // element has no post constraints
239            this.__element4a = element4a;
240            if (isMetafacadePropertyCachingEnabled())
241            {
242                this.__element4aSet = true;
243            }
244        }
245        return element4a;
246    }
247
248   /**
249    * @see org.andromda.cartridges.webservice.metafacades.WebServiceParameter#getRestPathParam()
250    * @return String
251    */
252    protected abstract String handleGetRestPathParam();
253
254    private String __restPathParam5a;
255    private boolean __restPathParam5aSet = false;
256
257    /**
258     * Customize the REST parameter path in the URL, by default it is /paramname/{paramvalue}/,
259     * appended to the /class/method/ URL.
260     * @return (String)handleGetRestPathParam()
261     */
262    public final String getRestPathParam()
263    {
264        String restPathParam5a = this.__restPathParam5a;
265        if (!this.__restPathParam5aSet)
266        {
267            // restPathParam has no pre constraints
268            restPathParam5a = handleGetRestPathParam();
269            // restPathParam has no post constraints
270            this.__restPathParam5a = restPathParam5a;
271            if (isMetafacadePropertyCachingEnabled())
272            {
273                this.__restPathParam5aSet = true;
274            }
275        }
276        return restPathParam5a;
277    }
278
279   /**
280    * @see org.andromda.cartridges.webservice.metafacades.WebServiceParameter#getRestParamType()
281    * @return String
282    */
283    protected abstract String handleGetRestParamType();
284
285    private String __restParamType6a;
286    private boolean __restParamType6aSet = false;
287
288    /**
289     * TODO: Model Documentation for
290     * org.andromda.cartridges.webservice.metafacades.WebServiceParameter.restParamType
291     * @return (String)handleGetRestParamType()
292     */
293    public final String getRestParamType()
294    {
295        String restParamType6a = this.__restParamType6a;
296        if (!this.__restParamType6aSet)
297        {
298            // restParamType has no pre constraints
299            restParamType6a = handleGetRestParamType();
300            // restParamType has no post constraints
301            this.__restParamType6a = restParamType6a;
302            if (isMetafacadePropertyCachingEnabled())
303            {
304                this.__restParamType6aSet = true;
305            }
306        }
307        return restParamType6a;
308    }
309
310   /**
311    * @see org.andromda.cartridges.webservice.metafacades.WebServiceParameter#isRestEncoded()
312    * @return boolean
313    */
314    protected abstract boolean handleIsRestEncoded();
315
316    private boolean __restEncoded7a;
317    private boolean __restEncoded7aSet = false;
318
319    /**
320     * TODO: Model Documentation for
321     * org.andromda.cartridges.webservice.metafacades.WebServiceParameter.restEncoded
322     * @return (boolean)handleIsRestEncoded()
323     */
324    public final boolean isRestEncoded()
325    {
326        boolean restEncoded7a = this.__restEncoded7a;
327        if (!this.__restEncoded7aSet)
328        {
329            // restEncoded has no pre constraints
330            restEncoded7a = handleIsRestEncoded();
331            // restEncoded has no post constraints
332            this.__restEncoded7a = restEncoded7a;
333            if (isMetafacadePropertyCachingEnabled())
334            {
335                this.__restEncoded7aSet = true;
336            }
337        }
338        return restEncoded7a;
339    }
340
341   /**
342    * @see org.andromda.cartridges.webservice.metafacades.WebServiceParameter#getRestPathSegment()
343    * @return String
344    */
345    protected abstract String handleGetRestPathSegment();
346
347    private String __restPathSegment8a;
348    private boolean __restPathSegment8aSet = false;
349
350    /**
351     * TODO: Model Documentation for
352     * org.andromda.cartridges.webservice.metafacades.WebServiceParameter.restPathSegment
353     * @return (String)handleGetRestPathSegment()
354     */
355    public final String getRestPathSegment()
356    {
357        String restPathSegment8a = this.__restPathSegment8a;
358        if (!this.__restPathSegment8aSet)
359        {
360            // restPathSegment has no pre constraints
361            restPathSegment8a = handleGetRestPathSegment();
362            // restPathSegment has no post constraints
363            this.__restPathSegment8a = restPathSegment8a;
364            if (isMetafacadePropertyCachingEnabled())
365            {
366                this.__restPathSegment8aSet = true;
367            }
368        }
369        return restPathSegment8a;
370    }
371
372    /**
373     * @return true
374     * @see ParameterFacade
375     */
376    public boolean isParameterFacadeMetaType()
377    {
378        return true;
379    }
380
381    /**
382     * @return true
383     * @see ModelElementFacade
384     */
385    public boolean isModelElementFacadeMetaType()
386    {
387        return true;
388    }
389
390    // ----------- delegates to ParameterFacade ------------
391    /**
392     * Copies all tagged values from the given ModelElementFacade to this model element facade.
393     * @see ModelElementFacade#copyTaggedValues(ModelElementFacade element)
394     */
395    public void copyTaggedValues(ModelElementFacade element)
396    {
397        this.getSuperParameterFacade().copyTaggedValues(element);
398    }
399
400    /**
401     * Finds the tagged value with the specified 'tagName'. In case there are more values the first
402     * one found will be returned.
403     * @see ModelElementFacade#findTaggedValue(String tagName)
404     */
405    public Object findTaggedValue(String tagName)
406    {
407        return this.getSuperParameterFacade().findTaggedValue(tagName);
408    }
409
410    /**
411     * Returns all the values for the tagged value with the specified name. The returned collection
412     * will contains only String instances, or will be empty. Never null.
413     * @see ModelElementFacade#findTaggedValues(String tagName)
414     */
415    public Collection<Object> findTaggedValues(String tagName)
416    {
417        return this.getSuperParameterFacade().findTaggedValues(tagName);
418    }
419
420    /**
421     * Returns the fully qualified name of the model element. The fully qualified name includes
422     * complete package qualified name of the underlying model element. The templates parameter will
423     * be replaced by the correct one given the binding relation of the parameter to this element.
424     * @see ModelElementFacade#getBindedFullyQualifiedName(ModelElementFacade bindedElement)
425     */
426    public String getBindedFullyQualifiedName(ModelElementFacade bindedElement)
427    {
428        return this.getSuperParameterFacade().getBindedFullyQualifiedName(bindedElement);
429    }
430
431    /**
432     * Gets all constraints belonging to the model element.
433     * @see ModelElementFacade#getConstraints()
434     */
435    public Collection<ConstraintFacade> getConstraints()
436    {
437        return this.getSuperParameterFacade().getConstraints();
438    }
439
440    /**
441     * Returns the constraints of the argument kind that have been placed onto this model. Typical
442     * kinds are "inv", "pre" and "post". Other kinds are possible.
443     * @see ModelElementFacade#getConstraints(String kind)
444     */
445    public Collection<ConstraintFacade> getConstraints(String kind)
446    {
447        return this.getSuperParameterFacade().getConstraints(kind);
448    }
449
450    /**
451     * Gets the documentation for the model element, The indent argument is prefixed to each line.
452     * By default this method wraps lines after 64 characters.
453     * This method is equivalent to <code>getDocumentation(indent, 64)</code>.
454     * @see ModelElementFacade#getDocumentation(String indent)
455     */
456    public String getDocumentation(String indent)
457    {
458        return this.getSuperParameterFacade().getDocumentation(indent);
459    }
460
461    /**
462     * This method returns the documentation for this model element, with the lines wrapped after
463     * the specified number of characters, values of less than 1 will indicate no line wrapping is
464     * required. By default paragraphs are returned as HTML.
465     * This method is equivalent to <code>getDocumentation(indent, lineLength, true)</code>.
466     * @see ModelElementFacade#getDocumentation(String indent, int lineLength)
467     */
468    public String getDocumentation(String indent, int lineLength)
469    {
470        return this.getSuperParameterFacade().getDocumentation(indent, lineLength);
471    }
472
473    /**
474     * This method returns the documentation for this model element, with the lines wrapped after
475     * the specified number of characters, values of less than 1 will indicate no line wrapping is
476     * required. HTML style determines if HTML Escaping is applied.
477     * @see ModelElementFacade#getDocumentation(String indent, int lineLength, boolean htmlStyle)
478     */
479    public String getDocumentation(String indent, int lineLength, boolean htmlStyle)
480    {
481        return this.getSuperParameterFacade().getDocumentation(indent, lineLength, htmlStyle);
482    }
483
484    /**
485     * The fully qualified name of this model element.
486     * @see ModelElementFacade#getFullyQualifiedName()
487     */
488    public String getFullyQualifiedName()
489    {
490        return this.getSuperParameterFacade().getFullyQualifiedName();
491    }
492
493    /**
494     * Returns the fully qualified name of the model element. The fully qualified name includes
495     * complete package qualified name of the underlying model element.  If modelName is true, then
496     * the original name of the model element (the name contained within the model) will be the name
497     * returned, otherwise a name from a language mapping will be returned.
498     * @see ModelElementFacade#getFullyQualifiedName(boolean modelName)
499     */
500    public String getFullyQualifiedName(boolean modelName)
501    {
502        return this.getSuperParameterFacade().getFullyQualifiedName(modelName);
503    }
504
505    /**
506     * Returns the fully qualified name as a path, the returned value always starts with out a slash
507     * '/'.
508     * @see ModelElementFacade#getFullyQualifiedNamePath()
509     */
510    public String getFullyQualifiedNamePath()
511    {
512        return this.getSuperParameterFacade().getFullyQualifiedNamePath();
513    }
514
515    /**
516     * Gets the unique identifier of the underlying model element.
517     * @see ModelElementFacade#getId()
518     */
519    public String getId()
520    {
521        return this.getSuperParameterFacade().getId();
522    }
523
524    /**
525     * UML2: Retrieves the keywords for this element. Used to modify implementation properties which
526     * are not represented by other properties, i.e. native, transient, volatile, synchronized,
527     * (added annotations) override, deprecated. Can also be used to suppress compiler warnings:
528     * (added annotations) unchecked, fallthrough, path, serial, finally, all. Annotations require
529     * JDK5 compiler level.
530     * @see ModelElementFacade#getKeywords()
531     */
532    public Collection<String> getKeywords()
533    {
534        return this.getSuperParameterFacade().getKeywords();
535    }
536
537    /**
538     * UML2: Retrieves a localized label for this named element.
539     * @see ModelElementFacade#getLabel()
540     */
541    public String getLabel()
542    {
543        return this.getSuperParameterFacade().getLabel();
544    }
545
546    /**
547     * The language mappings that have been set for this model element.
548     * @see ModelElementFacade#getLanguageMappings()
549     */
550    public TypeMappings getLanguageMappings()
551    {
552        return this.getSuperParameterFacade().getLanguageMappings();
553    }
554
555    /**
556     * Return the model containing this model element (multiple models may be loaded and processed
557     * at the same time).
558     * @see ModelElementFacade#getModel()
559     */
560    public ModelFacade getModel()
561    {
562        return this.getSuperParameterFacade().getModel();
563    }
564
565    /**
566     * The name of the model element.
567     * @see ModelElementFacade#getName()
568     */
569    public String getName()
570    {
571        return this.getSuperParameterFacade().getName();
572    }
573
574    /**
575     * Gets the package to which this model element belongs.
576     * @see ModelElementFacade#getPackage()
577     */
578    public ModelElementFacade getPackage()
579    {
580        return this.getSuperParameterFacade().getPackage();
581    }
582
583    /**
584     * The name of this model element's package.
585     * @see ModelElementFacade#getPackageName()
586     */
587    public String getPackageName()
588    {
589        return this.getSuperParameterFacade().getPackageName();
590    }
591
592    /**
593     * Gets the package name (optionally providing the ability to retrieve the model name and not
594     * the mapped name).
595     * @see ModelElementFacade#getPackageName(boolean modelName)
596     */
597    public String getPackageName(boolean modelName)
598    {
599        return this.getSuperParameterFacade().getPackageName(modelName);
600    }
601
602    /**
603     * Returns the package as a path, the returned value always starts with out a slash '/'.
604     * @see ModelElementFacade#getPackagePath()
605     */
606    public String getPackagePath()
607    {
608        return this.getSuperParameterFacade().getPackagePath();
609    }
610
611    /**
612     * UML2: Returns the value of the 'Qualified Name' attribute. A name which allows the
613     * NamedElement to be identified within a hierarchy of nested Namespaces. It is constructed from
614     * the names of the containing namespaces starting at the root of the hierarchy and ending with
615     * the name of the NamedElement itself.
616     * @see ModelElementFacade#getQualifiedName()
617     */
618    public String getQualifiedName()
619    {
620        return this.getSuperParameterFacade().getQualifiedName();
621    }
622
623    /**
624     * Gets the root package for the model element.
625     * @see ModelElementFacade#getRootPackage()
626     */
627    public PackageFacade getRootPackage()
628    {
629        return this.getSuperParameterFacade().getRootPackage();
630    }
631
632    /**
633     * Gets the dependencies for which this model element is the source.
634     * @see ModelElementFacade#getSourceDependencies()
635     */
636    public Collection<DependencyFacade> getSourceDependencies()
637    {
638        return this.getSuperParameterFacade().getSourceDependencies();
639    }
640
641    /**
642     * If this model element is the context of an activity graph, this represents that activity
643     * graph.
644     * @see ModelElementFacade#getStateMachineContext()
645     */
646    public StateMachineFacade getStateMachineContext()
647    {
648        return this.getSuperParameterFacade().getStateMachineContext();
649    }
650
651    /**
652     * The collection of ALL stereotype names for this model element.
653     * @see ModelElementFacade#getStereotypeNames()
654     */
655    public Collection<String> getStereotypeNames()
656    {
657        return this.getSuperParameterFacade().getStereotypeNames();
658    }
659
660    /**
661     * Gets all stereotypes for this model element.
662     * @see ModelElementFacade#getStereotypes()
663     */
664    public Collection<StereotypeFacade> getStereotypes()
665    {
666        return this.getSuperParameterFacade().getStereotypes();
667    }
668
669    /**
670     * Return the TaggedValues associated with this model element, under all stereotypes.
671     * @see ModelElementFacade#getTaggedValues()
672     */
673    public Collection<TaggedValueFacade> getTaggedValues()
674    {
675        return this.getSuperParameterFacade().getTaggedValues();
676    }
677
678    /**
679     * Gets the dependencies for which this model element is the target.
680     * @see ModelElementFacade#getTargetDependencies()
681     */
682    public Collection<DependencyFacade> getTargetDependencies()
683    {
684        return this.getSuperParameterFacade().getTargetDependencies();
685    }
686
687    /**
688     * Get the template parameter for this model element having the parameterName
689     * @see ModelElementFacade#getTemplateParameter(String parameterName)
690     */
691    public Object getTemplateParameter(String parameterName)
692    {
693        return this.getSuperParameterFacade().getTemplateParameter(parameterName);
694    }
695
696    /**
697     * Get the template parameters for this model element
698     * @see ModelElementFacade#getTemplateParameters()
699     */
700    public Collection<TemplateParameterFacade> getTemplateParameters()
701    {
702        return this.getSuperParameterFacade().getTemplateParameters();
703    }
704
705    /**
706     * The visibility (i.e. public, private, protected or package) of the model element, will
707     * attempt a lookup for these values in the language mappings (if any).
708     * @see ModelElementFacade#getVisibility()
709     */
710    public String getVisibility()
711    {
712        return this.getSuperParameterFacade().getVisibility();
713    }
714
715    /**
716     * Returns true if the model element has the exact stereotype (meaning no stereotype inheritance
717     * is taken into account when searching for the stereotype), false otherwise.
718     * @see ModelElementFacade#hasExactStereotype(String stereotypeName)
719     */
720    public boolean hasExactStereotype(String stereotypeName)
721    {
722        return this.getSuperParameterFacade().hasExactStereotype(stereotypeName);
723    }
724
725    /**
726     * Does the UML Element contain the named Keyword? Keywords can be separated by space, comma,
727     * pipe, semicolon, or << >>
728     * @see ModelElementFacade#hasKeyword(String keywordName)
729     */
730    public boolean hasKeyword(String keywordName)
731    {
732        return this.getSuperParameterFacade().hasKeyword(keywordName);
733    }
734
735    /**
736     * Returns true if the model element has the specified stereotype.  If the stereotype itself
737     * does not match, then a search will be made up the stereotype inheritance hierarchy, and if
738     * one of the stereotype's ancestors has a matching name this method will return true, false
739     * otherwise.
740     * For example, if we have a certain stereotype called <<exception>> and a model element has a
741     * stereotype called <<applicationException>> which extends <<exception>>, when calling this
742     * method with 'stereotypeName' defined as 'exception' the method would return true since
743     * <<applicationException>> inherits from <<exception>>.  If you want to check if the model
744     * element has the exact stereotype, then use the method 'hasExactStereotype' instead.
745     * @see ModelElementFacade#hasStereotype(String stereotypeName)
746     */
747    public boolean hasStereotype(String stereotypeName)
748    {
749        return this.getSuperParameterFacade().hasStereotype(stereotypeName);
750    }
751
752    /**
753     * True if there are target dependencies from this element that are instances of BindingFacade.
754     * Deprecated in UML2: Use TemplateBinding parameters instead of dependencies.
755     * @see ModelElementFacade#isBindingDependenciesPresent()
756     */
757    public boolean isBindingDependenciesPresent()
758    {
759        return this.getSuperParameterFacade().isBindingDependenciesPresent();
760    }
761
762    /**
763     * Indicates if any constraints are present on this model element.
764     * @see ModelElementFacade#isConstraintsPresent()
765     */
766    public boolean isConstraintsPresent()
767    {
768        return this.getSuperParameterFacade().isConstraintsPresent();
769    }
770
771    /**
772     * Indicates if any documentation is present on this model element.
773     * @see ModelElementFacade#isDocumentationPresent()
774     */
775    public boolean isDocumentationPresent()
776    {
777        return this.getSuperParameterFacade().isDocumentationPresent();
778    }
779
780    /**
781     * True if this element name is a reserved word in Java, C#, ANSI or ISO C, C++, JavaScript.
782     * @see ModelElementFacade#isReservedWord()
783     */
784    public boolean isReservedWord()
785    {
786        return this.getSuperParameterFacade().isReservedWord();
787    }
788
789    /**
790     * True is there are template parameters on this model element. For UML2, applies to Class,
791     * Operation, Property, and Parameter.
792     * @see ModelElementFacade#isTemplateParametersPresent()
793     */
794    public boolean isTemplateParametersPresent()
795    {
796        return this.getSuperParameterFacade().isTemplateParametersPresent();
797    }
798
799    /**
800     * True if this element name is a valid identifier name in Java, C#, ANSI or ISO C, C++,
801     * JavaScript. Contains no spaces, special characters etc. Constraint always applied on
802     * Enumerations and Interfaces, optionally applies on other model elements.
803     * @see ModelElementFacade#isValidIdentifierName()
804     */
805    public boolean isValidIdentifierName()
806    {
807        return this.getSuperParameterFacade().isValidIdentifierName();
808    }
809
810    /**
811     * Searches for the constraint with the specified 'name' on this model element, and if found
812     * translates it using the specified 'translation' from a translation library discovered by the
813     * framework.
814     * @see ModelElementFacade#translateConstraint(String name, String translation)
815     */
816    public String translateConstraint(String name, String translation)
817    {
818        return this.getSuperParameterFacade().translateConstraint(name, translation);
819    }
820
821    /**
822     * Translates all constraints belonging to this model element with the given 'translation'.
823     * @see ModelElementFacade#translateConstraints(String translation)
824     */
825    public String[] translateConstraints(String translation)
826    {
827        return this.getSuperParameterFacade().translateConstraints(translation);
828    }
829
830    /**
831     * Translates the constraints of the specified 'kind' belonging to this model element.
832     * @see ModelElementFacade#translateConstraints(String kind, String translation)
833     */
834    public String[] translateConstraints(String kind, String translation)
835    {
836        return this.getSuperParameterFacade().translateConstraints(kind, translation);
837    }
838
839    /**
840     * TODO: Model Documentation for ParameterFacade.defaultValue
841     * @see ParameterFacade#getDefaultValue()
842     */
843    public String getDefaultValue()
844    {
845        return this.getSuperParameterFacade().getDefaultValue();
846    }
847
848    /**
849     * UML2: A representation of the literals of the enumeration 'Parameter Effect Kind': CREATE,
850     * READ, UPDATE, DELETE. The datatype ParameterEffectKind is an enumeration that indicates the
851     * effect of a behavior on values passed in or out of its parameters.
852     * @see ParameterFacade#getEffect()
853     */
854    public String getEffect()
855    {
856        return this.getSuperParameterFacade().getEffect();
857    }
858
859    /**
860     * If this parameter is located on an event, this will represent that event.
861     * @see ParameterFacade#getEvent()
862     */
863    public EventFacade getEvent()
864    {
865        return this.getSuperParameterFacade().getEvent();
866    }
867
868    /**
869     * The name to use for accessors getting this parameter from a bean.
870     * @see ParameterFacade#getGetterName()
871     */
872    public String getGetterName()
873    {
874        return this.getSuperParameterFacade().getGetterName();
875    }
876
877    /**
878     * Fully Qualified TypeName, determined in part by multiplicity (for UML2). For UML14, same as
879     * getterName.
880     * @see ParameterFacade#getGetterSetterTypeName()
881     */
882    public String getGetterSetterTypeName()
883    {
884        return this.getSuperParameterFacade().getGetterSetterTypeName();
885    }
886
887    /**
888     * Fully Qualified implementation class of TypeName, determined in part by multiplicity (for
889     * UML2). If upper multiplicity =1, same as getterSetterTypeName.
890     * @see ParameterFacade#getGetterSetterTypeNameImpl()
891     */
892    public String getGetterSetterTypeNameImpl()
893    {
894        return this.getSuperParameterFacade().getGetterSetterTypeNameImpl();
895    }
896
897    /**
898     * the lower value for the multiplicity
899     * -only applicable for UML2
900     * @see ParameterFacade#getLower()
901     */
902    public int getLower()
903    {
904        return this.getSuperParameterFacade().getLower();
905    }
906
907    /**
908     * If this parameter is located on an operation, this will represent that operation.
909     * @see ParameterFacade#getOperation()
910     */
911    public OperationFacade getOperation()
912    {
913        return this.getSuperParameterFacade().getOperation();
914    }
915
916    /**
917     * The name to use for accessors getting this parameter in a bean.
918     * @see ParameterFacade#getSetterName()
919     */
920    public String getSetterName()
921    {
922        return this.getSuperParameterFacade().getSetterName();
923    }
924
925    /**
926     * A Classifier is a classification of instances - it describes a set of instances that have
927     * features
928     * in common. Can specify a generalization hierarchy by referencing its general classifiers. It
929     * may be
930     * a Class, DataType, PrimitiveType, Association, Collaboration, UseCase, etc. Can specify a
931     * generalization hierarchy by referencing its general classifiers. Has the capability to own
932     * collaboration uses. These collaboration uses link a collaboration with the classifier to give
933     * a
934     * description of the workings of the classifier. Classifier is defined to be a kind of
935     * templateable
936     * element so that a classifier can be parameterized. It is also defined to be a kind of
937     * parameterable
938     * element so that a classifier can be a formal template parameter.
939     * @see ParameterFacade#getType()
940     */
941    public ClassifierFacade getType()
942    {
943        return this.getSuperParameterFacade().getType();
944    }
945
946    /**
947     * the upper value of the multiplicity (will be -1 for *)
948     * -only applicable for UML2
949     * @see ParameterFacade#getUpper()
950     */
951    public int getUpper()
952    {
953        return this.getSuperParameterFacade().getUpper();
954    }
955
956    /**
957     * Indicates if the default value is present.
958     * @see ParameterFacade#isDefaultValuePresent()
959     */
960    public boolean isDefaultValuePresent()
961    {
962        return this.getSuperParameterFacade().isDefaultValuePresent();
963    }
964
965    /**
966     * UML2: Returns the value of the 'Is Exception' attribute. The default value is "false". Tells
967     * whether an output parameter may emit a value to the exclusion of the other outputs.
968     * @see ParameterFacade#isException()
969     */
970    public boolean isException()
971    {
972        return this.getSuperParameterFacade().isException();
973    }
974
975    /**
976     * True if this parameter is an 'in' parameter.
977     * @see ParameterFacade#isInParameter()
978     */
979    public boolean isInParameter()
980    {
981        return this.getSuperParameterFacade().isInParameter();
982    }
983
984    /**
985     * True if this parameter is an inout parameter.
986     * @see ParameterFacade#isInoutParameter()
987     */
988    public boolean isInoutParameter()
989    {
990        return this.getSuperParameterFacade().isInoutParameter();
991    }
992
993    /**
994     * If upper>1 or upper==unlimited. Only applies to UML2. For UML14, always false.
995     * @see ParameterFacade#isMany()
996     */
997    public boolean isMany()
998    {
999        return this.getSuperParameterFacade().isMany();
1000    }
1001
1002    /**
1003     * UML2 Only: Is parameter ordered within the Collection type. Ordered+Unique determines the
1004     * implementation Collection Type. For UML14, always false.
1005     * @see ParameterFacade#isOrdered()
1006     */
1007    public boolean isOrdered()
1008    {
1009        return this.getSuperParameterFacade().isOrdered();
1010    }
1011
1012    /**
1013     * True if this parameter is an 'out' parameter.
1014     * @see ParameterFacade#isOutParameter()
1015     */
1016    public boolean isOutParameter()
1017    {
1018        return this.getSuperParameterFacade().isOutParameter();
1019    }
1020
1021    /**
1022     * True if this parameter is readable, aka an in-parameter, or this feature is unspecified.
1023     * @see ParameterFacade#isReadable()
1024     */
1025    public boolean isReadable()
1026    {
1027        return this.getSuperParameterFacade().isReadable();
1028    }
1029
1030    /**
1031     * Whether or not this parameter is considered required (i.e must a non-empty value).
1032     * @see ParameterFacade#isRequired()
1033     */
1034    public boolean isRequired()
1035    {
1036        return this.getSuperParameterFacade().isRequired();
1037    }
1038
1039    /**
1040     * Whether or not this parameter represents a return parameter.
1041     * @see ParameterFacade#isReturn()
1042     */
1043    public boolean isReturn()
1044    {
1045        return this.getSuperParameterFacade().isReturn();
1046    }
1047
1048    /**
1049     * If Parameter type isMany (UML2), is the parameter unique within the Collection. Unique+Sorted
1050     * determines pareter implementation type. For UML14, always false.
1051     * @see ParameterFacade#isUnique()
1052     */
1053    public boolean isUnique()
1054    {
1055        return this.getSuperParameterFacade().isUnique();
1056    }
1057
1058    /**
1059     * True if this parameter is writable, aka an out-parameter, or this feature is unspecified.
1060     * @see ParameterFacade#isWritable()
1061     */
1062    public boolean isWritable()
1063    {
1064        return this.getSuperParameterFacade().isWritable();
1065    }
1066
1067    /**
1068     * @see MetafacadeBase#initialize()
1069     */
1070    @Override
1071    public void initialize()
1072    {
1073        this.getSuperParameterFacade().initialize();
1074    }
1075
1076    /**
1077     * @return Object getSuperParameterFacade().getValidationOwner()
1078     * @see MetafacadeBase#getValidationOwner()
1079     */
1080    @Override
1081    public Object getValidationOwner()
1082    {
1083        Object owner = this.getSuperParameterFacade().getValidationOwner();
1084        return owner;
1085    }
1086
1087    /**
1088     * @return String getSuperParameterFacade().getValidationName()
1089     * @see MetafacadeBase#getValidationName()
1090     */
1091    @Override
1092    public String getValidationName()
1093    {
1094        String name = this.getSuperParameterFacade().getValidationName();
1095        return name;
1096    }
1097
1098    /**
1099     * <p><b>Constraint:</b> org::andromda::cartridges::webservice::metafacades::WebServiceParameter::a web service parameter can not be of type collection</p>
1100     * <p><b>Error:</b> A web service parameter can NOT be a collection type You'll need to model an array instead.</p>
1101     * <p><b>OCL:</b> context WebServiceParameter inv :
1102return = false implies
1103type.collectionType = false</p>
1104     * @param validationMessages Collection<ModelValidationMessage>
1105     * @see MetafacadeBase#validateInvariants(Collection validationMessages)
1106     */
1107    @Override
1108    public void validateInvariants(Collection<ModelValidationMessage> validationMessages)
1109    {
1110        this.getSuperParameterFacade().validateInvariants(validationMessages);
1111        try
1112        {
1113            final Object contextElement = this.THIS();
1114            boolean constraintValid = OCLResultEnsurer.ensure((Boolean.valueOf(String.valueOf(OCLExpressions.equal(OCLIntrospector.invoke(contextElement,"return"),false))).booleanValue()?OCLExpressions.equal(OCLIntrospector.invoke(contextElement,"type.collectionType"),false):true));
1115            if (!constraintValid)
1116            {
1117                validationMessages.add(
1118                    new ModelValidationMessage(
1119                        (MetafacadeBase)contextElement ,
1120                        "org::andromda::cartridges::webservice::metafacades::WebServiceParameter::a web service parameter can not be of type collection",
1121                        "A web service parameter can NOT be a collection type You'll need to model an array instead."));
1122            }
1123        }
1124        catch (Throwable th)
1125        {
1126            Throwable cause = th.getCause();
1127            int depth = 0; // Some throwables have infinite recursion
1128            while (cause != null && depth < 7)
1129            {
1130                th = cause;
1131                depth++;
1132            }
1133            logger.error("Error validating constraint 'org::andromda::cartridges::webservice::metafacades::WebServiceParameter::a web service parameter can not be of type collection' ON "
1134                + this.THIS().toString() + ": " + th.getMessage(), th);
1135        }
1136    }
1137
1138    /**
1139     * The property that stores the name of the metafacade.
1140     */
1141    private static final String NAME_PROPERTY = "name";
1142    private static final String FQNAME_PROPERTY = "fullyQualifiedName";
1143
1144    /**
1145     * @see Object#toString()
1146     */
1147    @Override
1148    public String toString()
1149    {
1150        final StringBuilder toString = new StringBuilder(this.getClass().getName());
1151        toString.append("[");
1152        try
1153        {
1154            toString.append(Introspector.instance().getProperty(this, FQNAME_PROPERTY));
1155        }
1156        catch (final Throwable tryAgain)
1157        {
1158            try
1159            {
1160                toString.append(Introspector.instance().getProperty(this, NAME_PROPERTY));
1161            }
1162            catch (final Throwable ignore)
1163            {
1164                // - just ignore when the metafacade doesn't have a name or fullyQualifiedName property
1165            }
1166        }
1167        toString.append("]");
1168        return toString.toString();
1169    }
1170}