com.ashridgetech.jamda.uml
Class Operation

java.lang.Object
  |
  +--com.ashridgetech.jamda.uml.ModelElement
        |
        +--com.ashridgetech.jamda.uml.Feature
              |
              +--com.ashridgetech.jamda.uml.Operation
Direct Known Subclasses:
Constructor

public class Operation
extends Feature

A UML Operation, owned by a StructuredType.

Version:
1.0
Author:
paulb

Nested Class Summary
 
Nested classes inherited from class com.ashridgetech.jamda.uml.ModelElement
ModelElement.DuplicateElementException, ModelElement.ElementListStore, ModelElement.ElementNameListStore, ModelElement.ElementNameStore, ModelElement.ElementStore, ModelElement.TaggedValue, ModelElement.UnknownElementException
 
Field Summary
 
Fields inherited from class com.ashridgetech.jamda.uml.Feature
DEFAULT_OID_NAME
 
Fields inherited from class com.ashridgetech.jamda.uml.ModelElement
DUMMY_STORE
 
Constructor Summary
protected Operation(ru.novosoft.uml.foundation.core.MOperation mo, StructuredType owner)
          Initialises new ClassType during loading.
  Operation(StructuredType owner, java.lang.String name)
          Creates new Operation belonging to a StructuredType.
protected Operation(StructuredType owner, java.lang.String name, boolean dummy)
          Creates new Operation belonging to a StructuredType.
  Operation(StructuredType owner, java.lang.String name, StandardTypeDef returnTypeDef)
          Creates new Operation belonging to a StructuredType.
  Operation(StructuredType owner, java.lang.String name, Type returnType)
          Creates new Operation belonging to a StructuredType.
 
Method Summary
protected  void add(ModelElement me)
          Override the superclass method to store the return parameter separately.
 java.util.List addParameters(java.util.List properties, Stereotype stereotype)
          Add a Parameter to this Operation corresponding to each of a set of Propertys.
 void checkValid()
          Check whether this object is valid.
 Attribute getLinkedAttribute()
          Get the Attribute linked with this Operation.
 StructuredType getOwner()
          Get the owner of this Operation.
 Parameter getParameter(java.lang.String name)
          Get the Parameter of this Operation with a given name
 java.util.List getParameters()
          Get the Parameters of this Operation.
 Procedure getProcedure()
          Get the procedure for this Operation.
 Type getReturnType()
          Get the return Type of this Operation.
protected  ModelElement.ElementStore getSubElementStore(java.lang.Class meClass)
          Overridden to return the sub-element ModelElement.ElementStore into which an object of the class meClass should be stored.
 boolean isAbstract()
          Show whether this Operation is abstract.
 boolean isQuery()
          Show whether this Operation is marked as query only.
 boolean isReturnMultiple()
          Show whether the return Type of this Operation has multiple values.
protected  void load()
           
 Operation setAbstract(boolean isAbstract)
          Set whether this Operation is abstract.
 void setAfterProcedure(Procedure.Language language, java.lang.String afterText)
          Insert extra text after the body of the procedure of this Operation.
 void setBeforeProcedure(Procedure.Language language, java.lang.String beforeText)
          Insert extra text before the body of the procedure of this Operation.
 void setLinkedAttribute(Attribute attribute)
          Set the Attribute linked with this Operation.
 void setProcedure(Procedure.Language language, java.lang.String text)
          Set the procedure of this Operation.
 Operation setQuery(boolean isQuery)
          Set whether this Operation is marked as query only.
 Operation setStatic(boolean isStatic)
          Set whether this Operation is of static scope.
 Operation setVisibility(StructuredType.Visibility visibility)
          Set the visibility of this Operation.
 
Methods inherited from class com.ashridgetech.jamda.uml.Feature
getReaders, getVisibility, getWriters, isReadableBy, isStatic, isWritableBy, setFeatureStatic, setFeatureVisibility
 
Methods inherited from class com.ashridgetech.jamda.uml.ModelElement
addStereotype, addTaggedValue, addTaggedValue, addTaggedValues, addTaggedValuesInternal, checkInitialised, checkState, findTaggedValueCollection, getBooleanTaggedValue, getChildElements, getComment, getDescription, getDirectSource, getElement, getElementType, getFullName, getId, getModel, getName, getNsElement, getOriginalSource, getParentElement, getProperties, getStereotypes, getStringTaggedValue, getTaggedValue, getTaggedValues, getXpathContext, hasStereotype, hasTaggedValue, init, initLoad, isInitialised, load, load, loadElement, logChange, logger, logger, logLoad, logLoadWarning, logNew, logWarning, removeTaggedValue, select, setComment, setDirectSource, setTaggedValue, setTaggedValue, setTaggedValue, setTaggedValues, stereotype, tag, tagError, toString, type, type, type, xpath, xpathList
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Operation

public Operation(StructuredType owner,
                 java.lang.String name)
Creates new Operation belonging to a StructuredType.

Parameters:
owner - the StructuredType to which the new Operation will belong
name - the name of the Operation

Operation

public Operation(StructuredType owner,
                 java.lang.String name,
                 Type returnType)
Creates new Operation belonging to a StructuredType.

Parameters:
owner - the StructuredType to which the new Operation will belong
name - the name of the Operation
returnType - the Type returned by the new Operation

Operation

public Operation(StructuredType owner,
                 java.lang.String name,
                 StandardTypeDef returnTypeDef)
Creates new Operation belonging to a StructuredType.

Parameters:
owner - the StructuredType to which the new Operation will belong
name - the name of the Operation
returnTypeDef - the StandardTypeDef defining the Type returned by the new Operation

Operation

protected Operation(StructuredType owner,
                    java.lang.String name,
                    boolean dummy)
Creates new Operation belonging to a StructuredType.


Operation

protected Operation(ru.novosoft.uml.foundation.core.MOperation mo,
                    StructuredType owner)
Initialises new ClassType during loading.

Method Detail

getOwner

public StructuredType getOwner()
Get the owner of this Operation.

Returns:
the StructuredType to which this belongs
See Also:
ModelElement.getParentElement()

getParameters

public java.util.List getParameters()
Get the Parameters of this Operation.

Returns:
an unmodifiable list of Parameter objects, in the order in which they are defined in the model.

getParameter

public Parameter getParameter(java.lang.String name)
Get the Parameter of this Operation with a given name

Parameters:
name - the name of the required Attribute
Returns:
the Parameter whose name is name, or null if there is no such object

getReturnType

public Type getReturnType()
Get the return Type of this Operation.

Returns:
the return type, which may be the void Type, or null if this Operation has no return parameter

isReturnMultiple

public boolean isReturnMultiple()
Show whether the return Type of this Operation has multiple values.

Returns:
true if the Operation returns multiple values

getProcedure

public Procedure getProcedure()
Get the procedure for this Operation.

Returns:
the procedure object, or null if there is no procedure defined

setProcedure

public void setProcedure(Procedure.Language language,
                         java.lang.String text)
Set the procedure of this Operation.

Parameters:
language - the language in which the body is expressed by text
text - the body of the procedure

setBeforeProcedure

public void setBeforeProcedure(Procedure.Language language,
                               java.lang.String beforeText)
Insert extra text before the body of the procedure of this Operation. A newline is also inserted between beforeText and the existing body. If there is no existing Procedure, one is created.

Parameters:
language - the language in which the body is expressed by text
beforeText - the text to insert before the body of the procedure

setAfterProcedure

public void setAfterProcedure(Procedure.Language language,
                              java.lang.String afterText)
Insert extra text after the body of the procedure of this Operation. A newline is also inserted between the existing body and afterText. If there is no existing Procedure, one is created.

Parameters:
language - the language in which the body is expressed by text
afterText - the text to insert before the body of the procedure

isAbstract

public boolean isAbstract()
Show whether this Operation is abstract.

Returns:
true if this is abstract

setAbstract

public Operation setAbstract(boolean isAbstract)
Set whether this Operation is abstract.

Parameters:
isAbstract - true if this is to be abstract
Returns:
this object

setStatic

public Operation setStatic(boolean isStatic)
Set whether this Operation is of static scope.

Parameters:
isStatic - true if this is to be static
Returns:
this object

isQuery

public boolean isQuery()
Show whether this Operation is marked as query only.

Returns:
true if this is a query operation

setQuery

public Operation setQuery(boolean isQuery)
Set whether this Operation is marked as query only.

Parameters:
isQuery - true if this is to be query only
Returns:
this object

setVisibility

public Operation setVisibility(StructuredType.Visibility visibility)
Set the visibility of this Operation.

Parameters:
visibility - the Visibility instance representing this Operation's visibility - must not be null
Returns:
this object

getLinkedAttribute

public Attribute getLinkedAttribute()
Get the Attribute linked with this Operation.

Returns:
the Attribute
See Also:
setLinkedAttribute(com.ashridgetech.jamda.uml.Attribute)

setLinkedAttribute

public void setLinkedAttribute(Attribute attribute)
Set the Attribute linked with this Operation.

Parameters:
attribute - the Attribute to link
See Also:
getLinkedAttribute()

addParameters

public java.util.List addParameters(java.util.List properties,
                                    Stereotype stereotype)
Add a Parameter to this Operation corresponding to each of a set of Propertys. The source of each Parameter is set to the underlying element of the corresponding Property

Parameters:
properties - the Propertys which define the parameters
stereotype - the Stereotype to give each new Parameter - may be null
Returns:
the new Parameters

checkValid

public void checkValid()
                throws java.lang.IllegalStateException
Check whether this object is valid. Subclasses should call the superclass method if they override this method.

Overrides:
checkValid in class ModelElement
Throws:
java.lang.IllegalStateException - if a problem is found

getSubElementStore

protected ModelElement.ElementStore getSubElementStore(java.lang.Class meClass)
Overridden to return the sub-element ModelElement.ElementStore into which an object of the class meClass should be stored.

Overrides:
getSubElementStore in class ModelElement
Returns:
the store to use, or the superclass implementation if the class of the object is not stored by this class.

load

protected void load()
Overrides:
load in class ModelElement

add

protected void add(ModelElement me)
Override the superclass method to store the return parameter separately.

Overrides:
add in class ModelElement
Parameters:
me - The ModelElement to be added to the map Must not be null and its name property must not be null
Throws:
java.lang.IllegalArgumentException - if mp already belongs to another Model or a ModelPackage
java.lang.IllegalStateException - if attempt to add a return parameter when one already exists


Copyright © 2003 Ashridge Technologies Ltd. All Rights Reserved.