1
2
3
4 package org.andromda.metafacades.uml14;
5
6 /***
7 * MetafacadeLogic for org.andromda.metafacades.uml.StereotypeFacade
8 *
9 * @see org.andromda.metafacades.uml.StereotypeFacade
10 */
11 public abstract class StereotypeFacadeLogic
12 extends org.andromda.metafacades.uml14.GeneralizableElementFacadeLogicImpl
13 implements org.andromda.metafacades.uml.StereotypeFacade
14 {
15
16 protected org.omg.uml.foundation.core.Stereotype metaObject;
17
18 public StereotypeFacadeLogic(org.omg.uml.foundation.core.Stereotype metaObject, String context)
19 {
20 super(metaObject, getContext(context));
21 this.metaObject = metaObject;
22 }
23
24 /***
25 * Gets the context for this metafacade logic instance.
26 */
27 private static String getContext(String context)
28 {
29 if (context == null)
30 {
31 context = "org.andromda.metafacades.uml.StereotypeFacade";
32 }
33 return context;
34 }
35
36 /***
37 * @see org.andromda.core.metafacade.MetafacadeBase
38 */
39 public void resetMetafacadeContext(String context)
40 {
41 if (!this.contextRoot)
42 {
43 context = getContext(context);
44 setMetafacadeContext (context);
45 }
46 }
47
48 /***
49 * @see org.andromda.metafacades.uml.StereotypeFacade
50 */
51 public boolean isStereotypeFacadeMetaType()
52 {
53 return true;
54 }
55
56
57
58 /***
59 * @see org.andromda.core.metafacade.MetafacadeBase#validateInvariants(java.util.Collection)
60 */
61 public void validateInvariants(java.util.Collection validationMessages)
62 {
63 super.validateInvariants(validationMessages);
64 }
65
66 /***
67 * The property that stores the name of the metafacade.
68 */
69 private static final String NAME_PROPERTY = "name";
70
71 /***
72 * @see java.lang.Object#toString()
73 */
74 public String toString()
75 {
76 final StringBuffer toString = new StringBuffer(this.getClass().getName());
77 toString.append("[");
78 try
79 {
80 toString.append(org.andromda.core.common.Introspector.instance().getProperty(this, NAME_PROPERTY));
81 }
82 catch (final Throwable throwable)
83 {
84
85 }
86 toString.append("]");
87 return toString.toString();
88 }
89 }