001// license-header java merge-point
002//
003// Attention: generated code (by Metafacade.vsl) - do not modify!
004//
005package org.andromda.metafacades.uml;
006
007/**
008 * Condition or restriction expressed in natural language text or in a machine readable language for
009 * the purpose of declaring some of the semantics of an element.
010 *
011 * Metafacade interface to be used by AndroMDA cartridges.
012 */
013public interface ConstraintFacade
014    extends ModelElementFacade
015{
016    /**
017     * Indicates the metafacade type (used for metafacade mappings).
018     *
019     * @return boolean always <code>true</code>
020     */
021    public boolean isConstraintFacadeMetaType();
022
023    /**
024     * Gets the 'body' or text of this constraint.
025     * @return String
026     */
027    public String getBody();
028
029    /**
030     * Gets the model element to which the constraint applies (i.e. is the context of).
031     * @return ModelElementFacade
032     */
033    public ModelElementFacade getContextElement();
034
035    /**
036     * This constraint's translation for the argument languange.
037     * @param language String
038     * @return String
039     */
040    public String getTranslation(String language);
041
042    /**
043     * True if this constraint denotes a body expression.
044     * For example:
045     * <pre>
046     * context CustomerCard:getTransaction(from:Date, until:Date)
047     * body: transactions->select(date.isAfter(from) and date.isBefore(until))
048     * </pre>
049     * False otherwise.
050     * @return boolean
051     */
052    public boolean isBodyExpression();
053
054    /**
055     * True if this constraint denotes a definition.
056     * For example:
057     * <pre>
058     * context CustomerCard
059     * def: getTotalPoints(d: date) : Integer = transaction->select(date.isAfter(d)).points->sum()
060     * </pre>
061     * False otherwise.
062     * @return boolean
063     */
064    public boolean isDefinition();
065
066    /**
067     * True if this constraint denotes an invariant.
068     * For example:
069     * <pre>
070     * context LivingAnimal
071     * inv: alive = true
072     * </pre>
073     * False otherwise.
074     * @return boolean
075     */
076    public boolean isInvariant();
077
078    /**
079     * True if this constraint denotes a postcondition.
080     * For example:
081     * <pre>
082     * context LivingAnimal::getNumberOfLegs()
083     * post: numberOfLegs >= 0
084     * </pre>
085     * False otherwise.
086     * @return boolean
087     */
088    public boolean isPostCondition();
089
090    /**
091     * True if this constraint denotes a precondition.
092     * For example:
093     * <pre>
094     * context LivingAnimal::canFly()
095     * pre: hasWings = true
096     * </pre>
097     * False otherwise.
098     * @return boolean
099     */
100    public boolean isPreCondition();
101}