1 // license-header java merge-point
2 //
3 // Attention: generated code (by Metafacade.vsl) - do not modify!
4 //
5 package org.andromda.metafacades.uml;
6
7 /**
8 * Condition or restriction expressed in natural language text or in a machine readable language for
9 * the purpose of declaring some of the semantics of an element.
10 *
11 * Metafacade interface to be used by AndroMDA cartridges.
12 */
13 public interface ConstraintFacade
14 extends ModelElementFacade
15 {
16 /**
17 * Indicates the metafacade type (used for metafacade mappings).
18 *
19 * @return boolean always <code>true</code>
20 */
21 public boolean isConstraintFacadeMetaType();
22
23 /**
24 * Gets the 'body' or text of this constraint.
25 * @return String
26 */
27 public String getBody();
28
29 /**
30 * Gets the model element to which the constraint applies (i.e. is the context of).
31 * @return ModelElementFacade
32 */
33 public ModelElementFacade getContextElement();
34
35 /**
36 * This constraint's translation for the argument languange.
37 * @param language String
38 * @return String
39 */
40 public String getTranslation(String language);
41
42 /**
43 * True if this constraint denotes a body expression.
44 * For example:
45 * <pre>
46 * context CustomerCard:getTransaction(from:Date, until:Date)
47 * body: transactions->select(date.isAfter(from) and date.isBefore(until))
48 * </pre>
49 * False otherwise.
50 * @return boolean
51 */
52 public boolean isBodyExpression();
53
54 /**
55 * True if this constraint denotes a definition.
56 * For example:
57 * <pre>
58 * context CustomerCard
59 * def: getTotalPoints(d: date) : Integer = transaction->select(date.isAfter(d)).points->sum()
60 * </pre>
61 * False otherwise.
62 * @return boolean
63 */
64 public boolean isDefinition();
65
66 /**
67 * True if this constraint denotes an invariant.
68 * For example:
69 * <pre>
70 * context LivingAnimal
71 * inv: alive = true
72 * </pre>
73 * False otherwise.
74 * @return boolean
75 */
76 public boolean isInvariant();
77
78 /**
79 * True if this constraint denotes a postcondition.
80 * For example:
81 * <pre>
82 * context LivingAnimal::getNumberOfLegs()
83 * post: numberOfLegs >= 0
84 * </pre>
85 * False otherwise.
86 * @return boolean
87 */
88 public boolean isPostCondition();
89
90 /**
91 * True if this constraint denotes a precondition.
92 * For example:
93 * <pre>
94 * context LivingAnimal::canFly()
95 * pre: hasWings = true
96 * </pre>
97 * False otherwise.
98 * @return boolean
99 */
100 public boolean isPreCondition();
101 }