com.ashridgetech.jamda.uml
Class Constructor

java.lang.Object
  |
  +--com.ashridgetech.jamda.uml.ModelElement
        |
        +--com.ashridgetech.jamda.uml.Feature
              |
              +--com.ashridgetech.jamda.uml.Operation
                    |
                    +--com.ashridgetech.jamda.uml.Constructor

public class Constructor
extends Operation

A UML Operation for a constructor of a ClassType. Restricts the settings of some of the properties to ensure this is a valid constructor.

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
  Constructor(ClassType owner)
          Creates new constructor Constructor for a ClassType.
protected Constructor(ru.novosoft.uml.foundation.core.MOperation mo, ClassType owner)
          Initialises new Constructor during loading.
 
Method Summary
protected  void add(ModelElement me)
          Override the superclass method to store the return parameter separately.
 java.util.List addInitParameters(java.util.List properties)
          Add a Parameter to this Constructor corresponding to each of a set of Propertys.
 void checkValid()
          Check whether this object is valid.
 ClassType getClassType()
          Get the owner of this Constructor as a ClassType.
 Operation setAbstract(boolean isAbstract)
          Override Operation.setAbstract(boolean) to prevent this Constructor being made abstract.
 Operation setQuery(boolean isQuery)
          Override Operation.setQuery(boolean) to prevent this Constructor being marked as query only.
 Operation setStatic(boolean isStatic)
          Override Operation.setStatic(boolean) to prevent this Constructor being made static.
 
Methods inherited from class com.ashridgetech.jamda.uml.Operation
addParameters, getLinkedAttribute, getOwner, getParameter, getParameters, getProcedure, getReturnType, getSubElementStore, isAbstract, isQuery, isReturnMultiple, load, setAfterProcedure, setBeforeProcedure, setLinkedAttribute, setProcedure, setVisibility
 
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

Constructor

public Constructor(ClassType owner)
Creates new constructor Constructor for a ClassType.


Constructor

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

Method Detail

getClassType

public ClassType getClassType()
Get the owner of this Constructor as a ClassType. Returns the same instance as Operation.getOwner().

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

setAbstract

public Operation setAbstract(boolean isAbstract)
Override Operation.setAbstract(boolean) to prevent this Constructor being made abstract. Always throws an UnsupportedOperationException.

Overrides:
setAbstract in class Operation
Parameters:
isAbstract - ignored
Returns:
nothing - will always throw an exception

setStatic

public Operation setStatic(boolean isStatic)
Override Operation.setStatic(boolean) to prevent this Constructor being made static. Always throws an UnsupportedOperationException.

Overrides:
setStatic in class Operation
Parameters:
isStatic - ignored
Returns:
nothing - will always throw an exception

setQuery

public Operation setQuery(boolean isQuery)
Override Operation.setQuery(boolean) to prevent this Constructor being marked as query only. Always throws an UnsupportedOperationException.

Overrides:
setQuery in class Operation
Parameters:
isQuery - ignored
Returns:
nothing - will always throw an exception

addInitParameters

public java.util.List addInitParameters(java.util.List properties)
Add a Parameter to this Constructor corresponding to each of a set of Propertys. Each parameter is used to initialise the corresponding Attribute of the ClassType that owns this Constructor. The source of each Parameter is set to the underlying element of the corresponding Property.

Parameters:
properties - the Propertys which define the parameters. There must be an Attribute in the ClassType that contains this Constructor with the same ModelElement.getOriginalSource().
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 Operation
Throws:
java.lang.IllegalStateException - if a problem is found

add

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

Overrides:
add in class Operation
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


Copyright © 2003 Ashridge Technologies Ltd. All Rights Reserved.