org.eclipse.tigerstripe.profile.stereotype
Interface IStereotype


public interface IStereotype

Top-level interface for user-defined stereotypes. Users can define stereotypes within a Workbench Profile (@see org.eclipse.tigerstripe.api.profile.IWorkbenchProfile) that will be offered for selection when modeling a service contract. Each Stereotype has the following properties

Since:
1.2
Author:
Eric Dillon

Method Summary
 void addAttribute(IStereotypeAttribute attribute)
           
 void addToExcludesList(java.lang.String excludesStereotypeName)
           
 void addToRequiresList(java.lang.String requiredStereotypeName)
           
 org.dom4j.Element asElement()
          Returns an XML representation of this stereotype
 IStereotypeAttribute getAttributeByName(java.lang.String nameToGet)
           
 IStereotypeAttribute[] getAttributes()
           
 java.lang.String getDescription()
          Returns a short description of the meaning of the stereotype.
 java.lang.String[] getExcludesList()
          Get a array of the names of stereotypes that make up the excluded list.
 IStereotypeAttribute getIAttributeByName(java.lang.String nameToGet)
          Returns a specific attribute identified by the name that is passed.
 IStereotypeAttribute[] getIAttributes()
          Return an array of the defined attributes for this stereotype.
 java.lang.String getName()
          Returns the name (as seen by the end-user) of the stereotype.
 java.lang.String getParentStereotype()
          Returns the name of the parent of this stereotype (if any).
 IWorkbenchProfile getProfile()
          Returns the profile this stereotype belongs to.
 java.lang.String[] getRequiresList()
          Get a array of the names of stereotypes that make up the required list.
 IStereotypeScopeDetails getStereotypeScopeDetails()
          Get the applicability scopes for this stereotype.
 java.lang.String getVersion()
          Returns the version of the stereotype, for maintenance purposes.
 boolean isValidAttribute(IStereotypeAttribute attribute)
          Returns true if the given attribute is a defined attribute for this stereotype
 boolean isVisible()
          Returns the visibility of this stereotype.
 IStereotypeInstance makeInstance()
          Makes an instance of this stereotype and initializes all the attributes to their default values.
 void parse(org.dom4j.Element element)
          Parses the details of this from the given XML element
 void removeAttribute(IStereotypeAttribute attribute)
           
 void removeAttributes(IStereotypeAttribute[] attribute)
           
 void removeFromExcludesList(java.lang.String excludesStereotypeName)
           
 void removeFromExcludesList(java.lang.String[] excludesStereotypeName)
           
 void removeFromRequiresList(java.lang.String requiredStereotypeName)
           
 void removeFromRequiresList(java.lang.String[] requiredStereotypeName)
           
 void setAttributes(IStereotypeAttribute[] attributes)
           
 void setDescription(java.lang.String description)
           
 void setExcludesList(java.lang.String[] excludesStereotypeNames)
           
 void setName(java.lang.String name)
           
 void setParentStereotype(java.lang.String parentStereotype)
           
 void setRequiresList(java.lang.String[] requiredStereotypeNames)
           
 void setVersion(java.lang.String version)
           
 void setVisible(boolean isVisible)
          Sets the visibility of this stereotype
 

Method Detail

setName

void setName(java.lang.String name)

setVersion

void setVersion(java.lang.String version)

setDescription

void setDescription(java.lang.String description)

setVisible

void setVisible(boolean isVisible)
Sets the visibility of this stereotype

Parameters:
isVisible -

setAttributes

void setAttributes(IStereotypeAttribute[] attributes)
                   throws TigerstripeException
Throws:
TigerstripeException

addAttribute

void addAttribute(IStereotypeAttribute attribute)
                  throws TigerstripeException
Parameters:
attribute -
Throws:
TigerstripeException - if an attribute with the same name already exists.

removeAttribute

void removeAttribute(IStereotypeAttribute attribute)
                     throws TigerstripeException
Parameters:
attribute -
Throws:
TigerstripeException - if no attribute with that name exists.

removeAttributes

void removeAttributes(IStereotypeAttribute[] attribute)
                      throws TigerstripeException
Throws:
TigerstripeException

setRequiresList

void setRequiresList(java.lang.String[] requiredStereotypeNames)
                     throws TigerstripeException
Throws:
TigerstripeException

addToRequiresList

void addToRequiresList(java.lang.String requiredStereotypeName)
                       throws TigerstripeException
Throws:
TigerstripeException

removeFromRequiresList

void removeFromRequiresList(java.lang.String requiredStereotypeName)
                            throws TigerstripeException
Throws:
TigerstripeException

removeFromRequiresList

void removeFromRequiresList(java.lang.String[] requiredStereotypeName)
                            throws TigerstripeException
Throws:
TigerstripeException

setExcludesList

void setExcludesList(java.lang.String[] excludesStereotypeNames)
                     throws TigerstripeException
Throws:
TigerstripeException

addToExcludesList

void addToExcludesList(java.lang.String excludesStereotypeName)
                       throws TigerstripeException
Throws:
TigerstripeException

removeFromExcludesList

void removeFromExcludesList(java.lang.String excludesStereotypeName)
                            throws TigerstripeException
Throws:
TigerstripeException

removeFromExcludesList

void removeFromExcludesList(java.lang.String[] excludesStereotypeName)
                            throws TigerstripeException
Throws:
TigerstripeException

asElement

org.dom4j.Element asElement()
Returns an XML representation of this stereotype

Returns:

parse

void parse(org.dom4j.Element element)
           throws TigerstripeException
Parses the details of this from the given XML element

Parameters:
element -
Throws:
TigerstripeException

setParentStereotype

void setParentStereotype(java.lang.String parentStereotype)

makeInstance

IStereotypeInstance makeInstance()
Makes an instance of this stereotype and initializes all the attributes to their default values.

Returns:

getAttributes

IStereotypeAttribute[] getAttributes()

getAttributeByName

IStereotypeAttribute getAttributeByName(java.lang.String nameToGet)

getProfile

IWorkbenchProfile getProfile()
Returns the profile this stereotype belongs to.

Returns:

getDescription

java.lang.String getDescription()
Returns a short description of the meaning of the stereotype. This is used as ToolTip displayed to the end-user.

Returns:
a short description of the meaning of the stereotype

getExcludesList

java.lang.String[] getExcludesList()
Get a array of the names of stereotypes that make up the excluded list. The excludes list defines which other stereotypes can not be used in conjunction with a stereotype.

Returns:
array of the names of stereotypes in the excluded list

getIAttributeByName

IStereotypeAttribute getIAttributeByName(java.lang.String nameToGet)
Returns a specific attribute identified by the name that is passed. If no matching attribute is found, then null is returned.

Parameters:
nameToGet -
Returns:
attribute whose name matches the nameToGet parameter, or null.

getIAttributes

IStereotypeAttribute[] getIAttributes()
Return an array of the defined attributes for this stereotype. If no attributes are defined then an empty array is returned. For each stereotype, optional attributes can be defined so that the end-user can further specify the details of that stereotype. For example, string-entry attributes, checkable attributes, list-entry attributes, etc... Attributes can be marked as mandatory or optional, and should have a default value

Returns:
array of the defined attributes for this stereotype.

getName

java.lang.String getName()
Returns the name (as seen by the end-user) of the stereotype.

Returns:
the name (as seen by the end-user) of the stereotype

getParentStereotype

java.lang.String getParentStereotype()
Returns the name of the parent of this stereotype (if any). If there is no defined parent, then return an empty string.

Returns:
name of the parent stereotype

getRequiresList

java.lang.String[] getRequiresList()
Get a array of the names of stereotypes that make up the required list. The requires list defines which other stereotypes are required for a stereotype to be valid. This allows to define dependencies between multiple stereotypes that will be enforced when the end-user is trying to use them.

Returns:
array of the names of stereotypes in the required list

getStereotypeScopeDetails

IStereotypeScopeDetails getStereotypeScopeDetails()
Get the applicability scopes for this stereotype. The applicability scope of a stereotype conditions where the end-user can use it, i.e. on an artifact, on an attribute of an artifact, etc...

Returns:
an IStereotypeScopeDetails object that contains the sepcification of the scope.

getVersion

java.lang.String getVersion()
Returns the version of the stereotype, for maintenance purposes.

Returns:
the version of the stereotype

isValidAttribute

boolean isValidAttribute(IStereotypeAttribute attribute)
Returns true if the given attribute is a defined attribute for this stereotype

Parameters:
attribute -
Returns:
treu if the passed attribute defintion exactly matches one of the defined attributes.

isVisible

boolean isVisible()
Returns the visibility of this stereotype. A stereotype must be visible to be presented to the end-user. Since stereotypes can be defined as extensions of each others, this allows for "top-level stereotypes" that gather commonalities between stereotypes without having them visible to the end-user.

Returns:
true if this stereotype is to be presented to the user