org.andromda.metafacades.uml
Interface ConstraintFacade

All Superinterfaces:
ModelElementFacade

public interface ConstraintFacade
extends ModelElementFacade

Metafacade interface to be used by AndroMDA cartridges.


Method Summary
 String getBody()
           Gets the 'body' or text of this constraint.
 ModelElementFacade getContextElement()
           Gets the model element to which the constraint applies (i.e.
 String getTranslation(String language)
           This constraint's translation for the argument languange.
 boolean isBodyExpression()
           True if this constraint denotes a body expression.
 boolean isConstraintFacadeMetaType()
          Indicates the metafacade type (used for metafacade mappings).
 boolean isDefinition()
           True if this constraint denotes a definition.
 boolean isInvariant()
           True if this constraint denotes an invariant.
 boolean isPostCondition()
           True if this constraint denotes a postcondition.
 boolean isPreCondition()
           True if this constraint denotes a precondition.
 
Methods inherited from interface org.andromda.metafacades.uml.ModelElementFacade
copyTaggedValues, findTaggedValue, findTaggedValues, getConstraints, getConstraints, getDocumentation, getDocumentation, getDocumentation, getFullyQualifiedName, getFullyQualifiedName, getFullyQualifiedNamePath, getId, getLanguageMappings, getModel, getName, getPackage, getPackageName, getPackageName, getPackagePath, getRootPackage, getSourceDependencies, getStateMachineContext, getStereotypeNames, getStereotypes, getTaggedValues, getTargetDependencies, getTemplateParameter, getTemplateParameters, getValidationName, getValidationOwner, getVisibility, hasExactStereotype, hasStereotype, initialize, isBindingDependenciesPresent, isConstraintsPresent, isModelElementFacadeMetaType, isTemplateParametersPresent, translateConstraint, translateConstraints, translateConstraints, validateInvariants
 

Method Detail

isConstraintFacadeMetaType

public boolean isConstraintFacadeMetaType()
Indicates the metafacade type (used for metafacade mappings).

Returns:
always true

getBody

public String getBody()

Gets the 'body' or text of this constraint.


getContextElement

public ModelElementFacade getContextElement()

Gets the model element to which the constraint applies (i.e. is the context of).


getTranslation

public String getTranslation(String language)

This constraint's translation for the argument languange.


isBodyExpression

public boolean isBodyExpression()

True if this constraint denotes a body expression.

For example:

 

context CustomerCard:getTransaction(from:Date, until:Date)

body: transactions->select(date.isAfter(from) and date.isBefore(until))

False otherwise.


isDefinition

public boolean isDefinition()

True if this constraint denotes a definition.

For example:

 

context CustomerCard

def: getTotalPoints(d: date) : Integer = transaction->select(date.isAfter(d)).points->sum()

False otherwise.


isInvariant

public boolean isInvariant()

True if this constraint denotes an invariant.

For example:

 

context LivingAnimal

inv: alive = true

False otherwise.


isPostCondition

public boolean isPostCondition()

True if this constraint denotes a postcondition.

For example:

 

context LivingAnimal::getNumberOfLegs()

post: numberOfLegs >= 0

False otherwise.


isPreCondition

public boolean isPreCondition()

True if this constraint denotes a precondition.

For example:

 

context LivingAnimal::canFly()

pre: hasWings = true

False otherwise.



Copyright © 2003-2006 The AndroMDA Team. All Rights Reserved.