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