org.andromda.metafacades.uml
Interface ModelElementFacade

All Known Subinterfaces:
ActionFacade, ActionStateFacade, ActivityGraphFacade, ActorFacade, ArgumentFacade, AssociationClassFacade, AssociationEndFacade, AssociationFacade, AttributeFacade, AttributeLinkFacade, BindingFacade, CallActionFacade, CallEventFacade, ClassifierFacade, ConstraintFacade, DependencyFacade, Destination, Entity, EntityAssociation, EntityAssociationEnd, EntityAttribute, EntityQueryOperation, EnumerationFacade, EnumerationLiteralFacade, EventFacade, ExtendFacade, ExtensionPointFacade, FinalStateFacade, FrontEndAction, FrontEndActionState, FrontEndActivityGraph, FrontEndController, FrontEndControllerOperation, FrontEndEvent, FrontEndExceptionHandler, FrontEndFinalState, FrontEndForward, FrontEndPackage, FrontEndParameter, FrontEndPseudostate, FrontEndUseCase, FrontEndView, GeneralizableElementFacade, GeneralizationFacade, GuardFacade, IncludeFacade, InstanceFacade, InteractionFacade, LinkEndFacade, LinkFacade, ManageableEntity, ManageableEntityAssociationEnd, ManageableEntityAttribute, NamespaceFacade, NodeFacade, ObjectFlowStateFacade, OperationFacade, PackageFacade, ParameterFacade, PartitionFacade, PseudostateFacade, Queue, RedefinableTemplateSignatureFacade, Role, Service, ServiceOperation, StateFacade, StateMachineFacade, StateVertexFacade, StereotypeFacade, SubactivityStateFacade, TaggedValueFacade, Topic, TransitionFacade, UseCaseFacade, ValueObject, ValueObjectAssociationEnd

public interface ModelElementFacade

Represents a model element. It may be an Element or NamedElement. A named element is an element in a model that may have a name. An element is a constituent of a model. As such, it has the capability of owning other elements.

Metafacade interface to be used by AndroMDA cartridges.


Method Summary
 void copyTaggedValues(ModelElementFacade element)
           Copies all tagged values from the given ModelElementFacade to this model element facade.
 Object findTaggedValue(String tagName)
           Finds the tagged value with the specified 'tagName'.
 Collection findTaggedValues(String tagName)
           Returns all the values for the tagged value with the specified name.
 String getBindedFullyQualifiedName(ModelElementFacade bindedElement)
           Returns the fully qualified name of the model element.
 Collection<ConstraintFacade> getConstraints()
           Gets all constraints belonging to the model element.
 Collection getConstraints(String kind)
           Returns the constraints of the argument kind that have been placed onto this model.
 String getDocumentation(String indent)
           Gets the documentation for the model element, The indent argument is prefixed to each line.
 String getDocumentation(String indent, int lineLength)
           This method returns the documentation for this model element, with the lines wrapped after the specified number of characters, values of less than 1 will indicate no line wrapping is required.
 String getDocumentation(String indent, int lineLength, boolean htmlStyle)
           
 String getFullyQualifiedName()
           The fully qualified name of this model element.
 String getFullyQualifiedName(boolean modelName)
           Returns the fully qualified name of the model element.
 String getFullyQualifiedNamePath()
           Returns the fully qualified name as a path, the returned value always starts with out a slash '/'.
 String getId()
           Gets the unique identifier of the underlying model element.
 Collection<String> getKeywords()
           UML2: Retrieves the keywords for this element.
 String getLabel()
           UML2: Retrieves a localized label for this named element.
 TypeMappings getLanguageMappings()
           The language mappings that have been set for this model elemnt.
 ModelFacade getModel()
           
 String getName()
           The name of the model element.
 ModelElementFacade getPackage()
           Gets the package to which this model element belongs.
 String getPackageName()
           The name of this model element's package.
 String getPackageName(boolean modelName)
           Gets the package name (optionally providing the ability to retrieve the model name and not the mapped name).
 String getPackagePath()
           Returns the package as a path, the returned value always starts with out a slash '/'.
 String getQualifiedName()
           UML2: Returns the value of the 'Qualified Name' attribute.
 PackageFacade getRootPackage()
           Gets the root package for the model element.
 Collection<DependencyFacade> getSourceDependencies()
           Gets the dependencies for which this model element is the source.
 StateMachineFacade getStateMachineContext()
           If this model element is the context of an activity graph, this represents that activity graph.
 Collection<String> getStereotypeNames()
           The collection of ALL stereotype names for this model element.
 Collection<StereotypeFacade> getStereotypes()
           Gets all stereotypes for this model element.
 Collection<TaggedValueFacade> getTaggedValues()
           
 Collection<DependencyFacade> getTargetDependencies()
           Gets the dependencies for which this model element is the target.
 Object getTemplateParameter(String parameterName)
           
 Collection<TemplateParameterFacade> getTemplateParameters()
           
 String getValidationName()
          Gets the name of the metafacade used within validation messages.
 Object getValidationOwner()
          Gets the metafacade that acts as the owner of this metafacade.
 String getVisibility()
           The visibility (i.e.
 boolean hasExactStereotype(String stereotypeName)
           Returns true if the model element has the exact stereotype (meaning no stereotype inheritance is taken into account when searching for the stereotype), false otherwise.
 boolean hasKeyword(String keywordName)
           Does the UML Element contain the named Keyword? Keywords can be separated by space, comma, pipe, semicolon, or << >>
 boolean hasStereotype(String stereotypeName)
           Returns true if the model element has the specified stereotype.
 void initialize()
          Provides any required initialization of the metafacade.
 boolean isBindingDependenciesPresent()
           
 boolean isConstraintsPresent()
           Indicates if any constraints are present on this model element.
 boolean isDocumentationPresent()
           Indicates if any documentation is present on this model element.
 boolean isModelElementFacadeMetaType()
          Indicates the metafacade type (used for metafacade mappings).
 boolean isReservedWord()
           True if this element name is a reserved word in Java, C#, ANSI or ISO C, C++, JavaScript.
 boolean isTemplateParametersPresent()
           
 String translateConstraint(String name, String translation)
           Searches for the constraint with the specified 'name' on this model element, and if found translates it using the specified 'translation' from a translation library discovered by the framework.
 String[] translateConstraints(String translation)
           Translates all constraints belonging to this model element with the given 'translation'.
 String[] translateConstraints(String kind, String translation)
           Translates the constraints of the specified 'kind' belonging to this model element.
 void validateInvariants(Collection<ModelValidationMessage> validationMessages)
          Performs validation of any invariants found on this model element and stores the messages within the validationMessages collection.
 

Method Detail

isModelElementFacadeMetaType

boolean isModelElementFacadeMetaType()
Indicates the metafacade type (used for metafacade mappings).

Returns:
boolean always true

initialize

void initialize()
Provides any required initialization of the metafacade.


getValidationOwner

Object getValidationOwner()
Gets the metafacade that acts as the owner of this metafacade. (for example: an operation is an owner of its parameters, etc). This is used by AndroMDA's validation framework to provide more context as to where the error has occurred.

Returns:
Object the Validation Owner

getValidationName

String getValidationName()
Gets the name of the metafacade used within validation messages. This provides the full name of the metafacade.

Returns:
String the Validation Name

validateInvariants

void validateInvariants(Collection<ModelValidationMessage> validationMessages)
Performs validation of any invariants found on this model element and stores the messages within the validationMessages collection.

Parameters:
validationMessages - the collection of messages to which additional validation messages will be added if invariants are broken.

copyTaggedValues

void copyTaggedValues(ModelElementFacade element)

Copies all tagged values from the given ModelElementFacade to this model element facade.

Parameters:
element - ModelElementFacade

findTaggedValue

Object findTaggedValue(String tagName)

Finds the tagged value with the specified 'tagName'. In case there are more values the first one found will be returned.

Parameters:
tagName - String
Returns:
Object

findTaggedValues

Collection findTaggedValues(String tagName)

Returns all the values for the tagged value with the specified name. The returned collection will contains only String instances, or will be empty. Never null.

Parameters:
tagName - String
Returns:
Collection

getBindedFullyQualifiedName

String getBindedFullyQualifiedName(ModelElementFacade bindedElement)

Returns the fully qualified name of the model element. The fully qualified name includes complete package qualified name of the underlying model element. The templates parameter will be replaced by the correct one given the binding relation of the parameter to this element.

Parameters:
bindedElement - ModelElementFacade
Returns:
String

getConstraints

Collection<ConstraintFacade> getConstraints()

Gets all constraints belonging to the model element.

Returns:
Collection

getConstraints

Collection getConstraints(String kind)

Returns the constraints of the argument kind that have been placed onto this model. Typical kinds are "inv", "pre" and "post". Other kinds are possible.

Parameters:
kind - String
Returns:
Collection

getDocumentation

String getDocumentation(String indent)

Gets the documentation for the model element, The indent argument is prefixed to each line. By default this method wraps lines after 64 characters.

This method is equivalent to getDocumentation(indent, 64).

Parameters:
indent - String
Returns:
String

getDocumentation

String getDocumentation(String indent,
                        int lineLength)

This method returns the documentation for this model element, with the lines wrapped after the specified number of characters, values of less than 1 will indicate no line wrapping is required. By default paragraphs are returned as HTML.

This method is equivalent to getDocumentation(indent, lineLength, true).

Parameters:
indent - String
lineLength - int
Returns:
String

getDocumentation

String getDocumentation(String indent,
                        int lineLength,
                        boolean htmlStyle)
Parameters:
indent - String
lineLength - int
htmlStyle - boolean
Returns:
String

getFullyQualifiedName

String getFullyQualifiedName()

The fully qualified name of this model element.

Returns:
String

getFullyQualifiedName

String getFullyQualifiedName(boolean modelName)

Returns the fully qualified name of the model element. The fully qualified name includes complete package qualified name of the underlying model element. If modelName is true, then the original name of the model element (the name contained within the model) will be the name returned, otherwise a name from a language mapping will be returned.

Parameters:
modelName - boolean
Returns:
String

getFullyQualifiedNamePath

String getFullyQualifiedNamePath()

Returns the fully qualified name as a path, the returned value always starts with out a slash '/'.

Returns:
String

getId

String getId()

Gets the unique identifier of the underlying model element.

Returns:
String

getKeywords

Collection<String> getKeywords()

UML2: Retrieves the keywords for this element. Used to modify implementation properties which are not represented by other properties, i.e. native, transient, volatile, synchronized, (added annotations) override, deprecated. Can also be used to suppress compiler warnings: (added annotations) unchecked, fallthrough, path, serial, finally, all. Annotations require JDK5 compiler level.

Returns:
Collection

getLabel

String getLabel()

UML2: Retrieves a localized label for this named element.

Returns:
String

getLanguageMappings

TypeMappings getLanguageMappings()

The language mappings that have been set for this model elemnt.

Returns:
TypeMappings

getModel

ModelFacade getModel()
Returns:
ModelFacade

getName

String getName()

The name of the model element.

Returns:
String

getPackage

ModelElementFacade getPackage()

Gets the package to which this model element belongs.

Returns:
ModelElementFacade

getPackageName

String getPackageName()

The name of this model element's package.

Returns:
String

getPackageName

String getPackageName(boolean modelName)

Gets the package name (optionally providing the ability to retrieve the model name and not the mapped name).

Parameters:
modelName - boolean
Returns:
String

getPackagePath

String getPackagePath()

Returns the package as a path, the returned value always starts with out a slash '/'.

Returns:
String

getQualifiedName

String getQualifiedName()

UML2: Returns the value of the 'Qualified Name' attribute. A name which allows the NamedElement to be identified within a hierarchy of nested Namespaces. It is constructed from the names of the containing namespaces starting at the root of the hierarchy and ending with the name of the NamedElement itself.

Returns:
String

getRootPackage

PackageFacade getRootPackage()

Gets the root package for the model element.

Returns:
PackageFacade

getSourceDependencies

Collection<DependencyFacade> getSourceDependencies()

Gets the dependencies for which this model element is the source.

Returns:
Collection

getStateMachineContext

StateMachineFacade getStateMachineContext()

If this model element is the context of an activity graph, this represents that activity graph.

Returns:
StateMachineFacade

getStereotypeNames

Collection<String> getStereotypeNames()

The collection of ALL stereotype names for this model element.

Returns:
Collection

getStereotypes

Collection<StereotypeFacade> getStereotypes()

Gets all stereotypes for this model element.

Returns:
Collection

getTaggedValues

Collection<TaggedValueFacade> getTaggedValues()
Returns:
Collection

getTargetDependencies

Collection<DependencyFacade> getTargetDependencies()

Gets the dependencies for which this model element is the target.

Returns:
Collection

getTemplateParameter

Object getTemplateParameter(String parameterName)
Parameters:
parameterName - String
Returns:
Object

getTemplateParameters

Collection<TemplateParameterFacade> getTemplateParameters()
Returns:
Collection

getVisibility

String getVisibility()

The visibility (i.e. public, private, protected or package) of the model element, will attempt a lookup for these values in the language mappings (if any).

Returns:
String

hasExactStereotype

boolean hasExactStereotype(String stereotypeName)

Returns true if the model element has the exact stereotype (meaning no stereotype inheritance is taken into account when searching for the stereotype), false otherwise.

Parameters:
stereotypeName - String
Returns:
boolean

hasKeyword

boolean hasKeyword(String keywordName)

Does the UML Element contain the named Keyword? Keywords can be separated by space, comma, pipe, semicolon, or << >>

Parameters:
keywordName - String
Returns:
boolean

hasStereotype

boolean hasStereotype(String stereotypeName)

Returns true if the model element has the specified stereotype. If the stereotype itself does not match, then a search will be made up the stereotype inheritance hierarchy, and if one of the stereotype's ancestors has a matching name this method will return true, false otherwise.

For example, if we have a certain stereotype called <> and a model element has a stereotype called <> which extends <>, when calling this method with 'stereotypeName' defined as 'exception' the method would return true since <> inherits from <>. If you want to check if the model element has the exact stereotype, then use the method 'hasExactStereotype' instead.

Parameters:
stereotypeName - String
Returns:
boolean

isBindingDependenciesPresent

boolean isBindingDependenciesPresent()
Returns:
boolean

isConstraintsPresent

boolean isConstraintsPresent()

Indicates if any constraints are present on this model element.

Returns:
boolean

isDocumentationPresent

boolean isDocumentationPresent()

Indicates if any documentation is present on this model element.

Returns:
boolean

isReservedWord

boolean isReservedWord()

True if this element name is a reserved word in Java, C#, ANSI or ISO C, C++, JavaScript.

Returns:
boolean

isTemplateParametersPresent

boolean isTemplateParametersPresent()
Returns:
boolean

translateConstraint

String translateConstraint(String name,
                           String translation)

Searches for the constraint with the specified 'name' on this model element, and if found translates it using the specified 'translation' from a translation library discovered by the framework.

Parameters:
name - String
translation - String
Returns:
String

translateConstraints

String[] translateConstraints(String translation)

Translates all constraints belonging to this model element with the given 'translation'.

Parameters:
translation - String
Returns:
String[]

translateConstraints

String[] translateConstraints(String kind,
                              String translation)

Translates the constraints of the specified 'kind' belonging to this model element.

Parameters:
kind - String
translation - String
Returns:
String[]


Copyright © 2003-2012 AndroMDA.org. All Rights Reserved.