org.andromda.core.cartridge.template
Class ModelElement

java.lang.Object
  extended by org.andromda.core.cartridge.template.ModelElement

public class ModelElement
extends Object

Represents a single template <modelElement/> nested within the <modelElements/> element. It stores the actual metafacade instances which match the model element criteria (i.e. stereotype, type, etc) defined by this instance.

Author:
Chad Brandon, Bob Fields
See Also:
ModelElements

Constructor Summary
ModelElement()
           
 
Method Summary
 void addType(Type type)
          Adds the type to the collection of types belonging to this model element.
 Collection<MetafacadeBase> getMetafacades()
          Gets the metafacades that belong to this ModelElement instance.
 String getStereotype()
          Gets the stereotype of this modelElement.
 Collection<Type> getTypes()
          Gets all types associated with this model element.
 String getVariable()
          Gets the variable stereotype of this modelElement (this is what is made available to a template during processing).
 boolean hasStereotype()
          Returns true or false depending on whether or not this model element has a stereotype defined.
 boolean hasTypes()
          Returns true or false depending on whether or not this model element has any type elements defined.
 void setMetafacades(Collection<MetafacadeBase> metafacades)
          Sets the current metafacades that belong to this ModelElement instance.
 void setStereotype(String stereotype)
          Sets the stereotype of the ModelElement.
 void setVariable(String variable)
          Sets the variable name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelElement

public ModelElement()
Method Detail

getStereotype

public String getStereotype()
Gets the stereotype of this modelElement.

Returns:
Returns the stereotype.

hasStereotype

public boolean hasStereotype()
Returns true or false depending on whether or not this model element has a stereotype defined.

Returns:
true/false

getTypes

public Collection<Type> getTypes()
Gets all types associated with this model element.

Returns:
the collection of types.

hasTypes

public boolean hasTypes()
Returns true or false depending on whether or not this model element has any type elements defined.

Returns:
true/false

setStereotype

public void setStereotype(String stereotype)
Sets the stereotype of the ModelElement.

Parameters:
stereotype - The stereotype to set.

addType

public void addType(Type type)
Adds the type to the collection of types belonging to this model element.

Parameters:
type - the Typeinstance.

getVariable

public String getVariable()
Gets the variable stereotype of this modelElement (this is what is made available to a template during processing).

Returns:
Returns the variable.

setVariable

public void setVariable(String variable)
Sets the variable name.

Parameters:
variable - The variable to set.

setMetafacades

public void setMetafacades(Collection<MetafacadeBase> metafacades)
Sets the current metafacades that belong to this ModelElement instance.

Parameters:
metafacades - the collection of metafacades

getMetafacades

public Collection<MetafacadeBase> getMetafacades()
Gets the metafacades that belong to this ModelElement instance. These are the actual elements from the model.

Returns:
the collection of metafacades.


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