com.ashridgetech.jamda.uml
Class ModelElement

java.lang.Object
  |
  +--com.ashridgetech.jamda.uml.ModelElement
Direct Known Subclasses:
Abstraction, Actor, Association, Association.End, Feature, Generalization, Model, ModelPackage, Parameter, Stereotype, TagDefinition, Type

public abstract class ModelElement
extends java.lang.Object

Base class with common functionality for all Jamda UML elements which can be contained within a Model, and Model itself. XXX TO Do: check has stereotype if adding stereotype-dependent tags

Version:
1.0
Author:
paulb

Nested Class Summary
static class ModelElement.DuplicateElementException
          Thrown by loadElement(ru.novosoft.uml.foundation.core.MModelElement) to indicate a duplicate element.
protected static class ModelElement.ElementListStore
           
protected static class ModelElement.ElementNameListStore
           
protected static class ModelElement.ElementNameStore
           
protected static class ModelElement.ElementStore
           
 class ModelElement.TaggedValue
          Utility class to hold an Object which is stored in a Tagged Value.
static class ModelElement.UnknownElementException
          Thrown by loadElement(ru.novosoft.uml.foundation.core.MModelElement) to indicate an unknown element.
 
Field Summary
protected static ModelElement.ElementStore DUMMY_STORE
          Returned from getSubElementStore(java.lang.Class) to indicate an element will not be stored.
 
Constructor Summary
protected ModelElement(ru.novosoft.uml.foundation.core.MModelElement me, ModelElement parent)
          Creates new ModelElement during loading.
 
Method Summary
protected  void add(ModelElement me)
          Add a child element to this ModelElement.
 void addStereotype(Stereotype stereotype)
          Adds a Stereotype to this object.
 void addTaggedValue(TagDefinition tagDef, ModelElement newValue)
          Add a tagged value to those stored in this element under a certain TagDefinition.
 void addTaggedValue(TagDefinition tagDef, java.lang.String newValue)
          Add a Stringtagged value to those stored in this element under a certain TagDefinition.
 void addTaggedValues(TagDefinition tagDef, java.util.Collection newValues)
          Add some tagged value(s) to those stored in this element under a certain TagDefinition.
protected  void addTaggedValuesInternal(TagDefinition tagDef, java.util.Collection newValues, boolean multiple, boolean replace)
          Add a new set of values to a tagged value collection, ensuring that they have the correct type.
protected  void checkInitialised()
           
protected  void checkState(boolean condition, java.lang.String message)
           
 void checkValid()
          Check whether this object is valid.
protected  java.util.Collection findTaggedValueCollection(TagDefinition tagDef, boolean create)
          Get the tagged value collection stored in this element under a certain TagDefinition.
 boolean getBooleanTaggedValue(TagDefinition tagDef)
          Get the boolean tagged value stored in this element under a certain TagDefinition.
 java.util.List getChildElements()
          Get all the ModelElements which this one contains.
 java.lang.String getComment()
          Get the comment for this element, which is all the comments in the model for this element concatenated.
 java.lang.String getDescription()
          Get a description of this element for logging
 ModelElement getDirectSource()
          Get the ModelElement which was the immediate source for generating this one, if any.
protected  ModelElement getElement(ru.novosoft.uml.foundation.core.MModelElement me)
          Get the ModelElement which is the wrapper for a NSUML MModelElement.
 java.lang.String getElementType()
          Get the name of the type of element.
 java.lang.String getFullName()
          Get the fully qualified name of this element, including the names of the containing elements up to but excluding the Model or 'Data types' ModelPackage.
 java.lang.String getId()
          Get the XMI id of this element
 Model getModel()
          Get the Model to which this package belongs, either directly or indirectly.
 java.lang.String getName()
          Get the name of this element, excluding the names of the containing elements.
(package private)  ru.novosoft.uml.foundation.core.MModelElement getNsElement()
          Get the NSUML MModelElement which this object wraps, as set in the constructor.
 ModelElement getOriginalSource()
          Get the ModelElement which was the original source for generating this one, if any.
 ModelElement getParentElement()
          Get the ModelElement which contains this one, if any.
static java.util.List getProperties(java.util.Collection elements)
          Get the Propertys for a Collection of PropertyElements.
 java.util.Collection getStereotypes()
          Get the Stereotypes which apply to this element.
 java.lang.String getStringTaggedValue(TagDefinition tagDef)
          Get the String tagged value stored in this element under a certain TagDefinition.
protected  ModelElement.ElementStore getSubElementStore(java.lang.Class meClass)
          Must be overridden by subclasses to return the sub-element ModelElement.ElementStore into which an object of the class meClass should be stored, if they wish to store objects of this class.
 java.lang.Object getTaggedValue(TagDefinition tagDef)
          Get the single tagged value(s) stored in this element under a certain TagDefinition.
 java.util.Collection getTaggedValues(TagDefinition tagDef)
          Get the tagged value(s) stored in this element under a certain TagDefinition.
 org.apache.commons.jxpath.JXPathContext getXpathContext()
          Get the XPath context for this ModelElement.
 boolean hasStereotype(Stereotype stereotype)
          Tests whether this element has a certain Stereotype.
 boolean hasTaggedValue(TagDefinition tagDef)
          Show whether this element has a tagged value for a certain TagDefinition.
protected  void init(java.lang.Class c)
          Initialises this object when creating a new object, not loading from a file.
protected  void initLoad(java.lang.Class c, boolean loading)
          MUST be called by subclass constructors.
 boolean isInitialised()
          Show whether this element is fully initialised yet.
protected  void load()
           
protected  void load(java.util.Collection c, java.lang.String description)
          Load all the MModelElements of a given collection.
protected  void load(java.util.Collection c, java.lang.String description, java.lang.Class elementClass)
          Load the MModelElements of a given collection, choosing those which are instances of a certain class.
protected  ModelElement loadElement(ru.novosoft.uml.foundation.core.MModelElement element)
          Return the appropriate ModelElement for the NSUML element being loaded.
protected  void logChange(java.lang.String message)
          Log a message reporting a change to an element
protected  org.apache.log4j.Logger logger()
           
protected static org.apache.log4j.Logger logger(java.lang.Class c)
           
protected  void logLoad(java.lang.String message)
          Log a message reporting progress of loading a model.
protected  void logLoadWarning(java.lang.String message)
          Log a warning message about loading a model.
protected  void logNew(java.lang.String message)
          Log a message reporting a new element added to a model.
protected  void logWarning(java.lang.String message)
          Log a general warning message.
protected  void removeTaggedValue(TagDefinition tagDef)
          Remove the tagged value stored in this element under a certain TagDefinition, if it exists.
static java.util.List select(java.util.Collection c, Stereotype stereotype)
          Select from a collection of ModelElements those with a given Stereotype.
 void setComment(java.lang.String comment)
          Set the comment for this element.
 void setDirectSource(ModelElement source)
          Set the ModelElement which was the immediate source for generating this one, if any.
 void setTaggedValue(TagDefinition tagDef, boolean newValue)
          Set the ooleantagged value stored in this element under a certain TagDefinition.
 void setTaggedValue(TagDefinition tagDef, ModelElement newValue)
          Set a single tagged value stored in this element under a certain TagDefinition.
 void setTaggedValue(TagDefinition tagDef, java.lang.String newValue)
          Set the Stringtagged value stored in this element under a certain TagDefinition.
 void setTaggedValues(TagDefinition tagDef, java.util.Collection newValues)
          Set the tagged value(s) stored in this element under a certain TagDefinition.
 Stereotype stereotype(StandardStereotypeDef stereotypeDef)
          Get a Stereotype from the model using a standard definition.
 TagDefinition tag(StandardTagDef tagDef)
          Get a tag definition from the model using a standard definition.
protected  java.lang.String tagError(java.lang.String description, TagDefinition tagDef, java.util.Collection tagColl)
          Utility method to get an error message for a tag-related error.
 java.lang.String toString()
           
 ClassType type(StandardClassDef typeDef)
          Get a ClassType from the model using a standard definition.
 DataType type(StandardDataTypeDef typeDef)
          Get a DataType from the model using a standard definition.
 InterfaceType type(StandardInterfaceDef typeDef)
          Get a InterfaceType from the model using a standard definition.
 java.lang.Object xpath(java.lang.String expr)
          Evaluate an XPath expression for a single object in the context returned by getXpathContext().
 java.util.List xpathList(java.lang.String expr)
          Evaluate an XPath expression for a list of objects in the context returned by getXpathContext().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DUMMY_STORE

protected static final ModelElement.ElementStore DUMMY_STORE
Returned from getSubElementStore(java.lang.Class) to indicate an element will not be stored.

Constructor Detail

ModelElement

protected ModelElement(ru.novosoft.uml.foundation.core.MModelElement me,
                       ModelElement parent)
Creates new ModelElement during loading.

Parameters:
me - the NSUML element from which this object is being loaded
parent - the element which contains this one ( must be null for a Model
Method Detail

select

public static java.util.List select(java.util.Collection c,
                                    Stereotype stereotype)
Select from a collection of ModelElements those with a given Stereotype.

Parameters:
c - the Collection from which to select. Every element must be an object of a subclass of ModelElement.
stereotype - the Stereotype by which to select elements
Returns:
the selected ModelElements in an unmodifiable list

getProperties

public static java.util.List getProperties(java.util.Collection elements)
Get the Propertys for a Collection of PropertyElements.

Parameters:
elements - the Collection of elements - all must implement PropertyElement
Returns:
a new List of Propertys. The list is modifiable and under the control of the caller.

initLoad

protected void initLoad(java.lang.Class c,
                        boolean loading)
MUST be called by subclass constructors. Returns without any action if it is not called from the lowest level subclass. MAy also be called via init(java.lang.Class), which sets loading to false.

Parameters:
c - the STATIC class of the object making the call, from XYZ.class, not getClass()
loading - true if this object is being created from an existing NSUML object, false if it is a completely new object

init

protected void init(java.lang.Class c)
Initialises this object when creating a new object, not loading from a file.

Parameters:
c - the STATIC class of the object making the call, from XYZ.class, not getClass()

logLoad

protected void logLoad(java.lang.String message)
Log a message reporting progress of loading a model.


logNew

protected void logNew(java.lang.String message)
Log a message reporting a new element added to a model.


logChange

protected void logChange(java.lang.String message)
Log a message reporting a change to an element


logLoadWarning

protected void logLoadWarning(java.lang.String message)
Log a warning message about loading a model.


logWarning

protected void logWarning(java.lang.String message)
Log a general warning message.


getModel

public Model getModel()
Get the Model to which this package belongs, either directly or indirectly. Must be overridden by subclasses which do not have a parent.


getName

public java.lang.String getName()
Get the name of this element, excluding the names of the containing elements.


getId

public java.lang.String getId()
Get the XMI id of this element


getFullName

public java.lang.String getFullName()
Get the fully qualified name of this element, including the names of the containing elements up to but excluding the Model or 'Data types' ModelPackage.


getComment

public java.lang.String getComment()
Get the comment for this element, which is all the comments in the model for this element concatenated. Note: gets comment from either the comment's name or body, as it is uncertain which should be used. If both are present, a warning is logged

Returns:
the comment

setComment

public void setComment(java.lang.String comment)
Set the comment for this element. Replaces all the comments in the model for this element with a new one. Note: sets comment in the Model Element name, NOT the body as this is where MagicDraw stores it.

Parameters:
comment - the new comment

getDescription

public java.lang.String getDescription()
Get a description of this element for logging


getStereotypes

public java.util.Collection getStereotypes()
Get the Stereotypes which apply to this element. Note: this method may not be called until the Model to which this element belongs is fully initialised.

Returns:
an unmodifiable collection of Stereotype objects
Throws:
IllegalStateException - if the Model is not initialised
See Also:
#getModel

hasStereotype

public boolean hasStereotype(Stereotype stereotype)
Tests whether this element has a certain Stereotype. Note: this method uses getStereotypes() and has the same restrictions.

Parameters:
stereotype - the Stereotype to test for
Returns:
true if this element has the given Stereotype
See Also:
getStereotypes()

addStereotype

public void addStereotype(Stereotype stereotype)
Adds a Stereotype to this object.

Parameters:
stereotype - the Stereotype to add
Throws:
IllegalStateException - if this object already has stereotype
See Also:
#hasStereotype

getTaggedValues

public java.util.Collection getTaggedValues(TagDefinition tagDef)
Get the tagged value(s) stored in this element under a certain TagDefinition.

Parameters:
tagDef - the TagDefinition whose values are required
Returns:
an unmodifiable collection of Objects. If this element does not have a tag corresponding to tagDef, returns an empty collection. If tagDef's TagDefinition.isReferenceType() method returns true, the collection contains the ModelElements referred to by the tagged values, otherwise the actual String or Boolean values.
See Also:
hasTaggedValue(com.ashridgetech.jamda.uml.TagDefinition), getTaggedValue(com.ashridgetech.jamda.uml.TagDefinition)

getTaggedValue

public java.lang.Object getTaggedValue(TagDefinition tagDef)
Get the single tagged value(s) stored in this element under a certain TagDefinition.

Parameters:
tagDef - the TagDefinition whose value is required. Must have an upper multiplicity of 1.
Returns:
the tagged value, or null if there are no values with the tag, or this element does not have the tag
See Also:
hasTaggedValue(com.ashridgetech.jamda.uml.TagDefinition), getTaggedValues(com.ashridgetech.jamda.uml.TagDefinition)

getBooleanTaggedValue

public boolean getBooleanTaggedValue(TagDefinition tagDef)
Get the boolean tagged value stored in this element under a certain TagDefinition.

Parameters:
tagDef - the TagDefinition whose value is required. Must have an upper multiplicity of 1.
Returns:
the tagged value, or false if there are no values with the tag, or this element does not have the tag
See Also:
hasTaggedValue(com.ashridgetech.jamda.uml.TagDefinition), getTaggedValue(com.ashridgetech.jamda.uml.TagDefinition)

getStringTaggedValue

public java.lang.String getStringTaggedValue(TagDefinition tagDef)
Get the String tagged value stored in this element under a certain TagDefinition.

Parameters:
tagDef - the TagDefinition whose value is required. Must have an upper multiplicity of 1.
Returns:
the tagged value, or false if there are no values with the tag, or this element does not have the tag
See Also:
hasTaggedValue(com.ashridgetech.jamda.uml.TagDefinition), getTaggedValue(com.ashridgetech.jamda.uml.TagDefinition)

hasTaggedValue

public boolean hasTaggedValue(TagDefinition tagDef)
Show whether this element has a tagged value for a certain TagDefinition.

Parameters:
tagDef - the TagDefinition whose presence is to be tested
Returns:
true if this element has a tag corresponding to tagDef

addTaggedValue

public void addTaggedValue(TagDefinition tagDef,
                           ModelElement newValue)
Add a tagged value to those stored in this element under a certain TagDefinition.

Parameters:
tagDef - the TagDefinition whose values are to be set - must support multiple values, as defined by its TagDefinition.isMultiple() method
newValue - the additional value for this tag - must be a permitted value for the tagDef, as defined by its TagDefinition.isPermittedValue(java.lang.Object) method
See Also:
getTaggedValues(com.ashridgetech.jamda.uml.TagDefinition), addTaggedValues(com.ashridgetech.jamda.uml.TagDefinition, java.util.Collection), addTaggedValue(TagDefinition,String), setTaggedValue(TagDefinition,ModelElement)

addTaggedValue

public void addTaggedValue(TagDefinition tagDef,
                           java.lang.String newValue)
Add a Stringtagged value to those stored in this element under a certain TagDefinition.

Parameters:
tagDef - the TagDefinition whose values are to be set - must support multiple values, as defined by its TagDefinition.isMultiple() method
newValue - the additional value for this tag - must be a permitted value for the tagDef, as defined by its TagDefinition.isPermittedValue(java.lang.Object) method
See Also:
getTaggedValues(com.ashridgetech.jamda.uml.TagDefinition), addTaggedValues(com.ashridgetech.jamda.uml.TagDefinition, java.util.Collection), addTaggedValue(TagDefinition,ModelElement)

addTaggedValues

public void addTaggedValues(TagDefinition tagDef,
                            java.util.Collection newValues)
Add some tagged value(s) to those stored in this element under a certain TagDefinition.

Parameters:
tagDef - the TagDefinition whose values are to be set
newValues - the new values for this tag - must be permitted values for the tagDef, as defined by its TagDefinition.isPermittedValue(java.lang.Object) method
See Also:
getTaggedValues(com.ashridgetech.jamda.uml.TagDefinition), setTaggedValues(com.ashridgetech.jamda.uml.TagDefinition, java.util.Collection)

setTaggedValue

public void setTaggedValue(TagDefinition tagDef,
                           ModelElement newValue)
Set a single tagged value stored in this element under a certain TagDefinition.

Parameters:
tagDef - the TagDefinition whose values are to be set - must support only single values, as defined by its TagDefinition.isMultiple() method
newValue - the additional value for this tag - must be a permitted value for the tagDef, as defined by its TagDefinition.isPermittedValue(java.lang.Object) method
See Also:
getTaggedValue(com.ashridgetech.jamda.uml.TagDefinition), setTaggedValues(com.ashridgetech.jamda.uml.TagDefinition, java.util.Collection), addTaggedValue(TagDefinition,ModelElement), setTaggedValue(TagDefinition,String), setTaggedValue(TagDefinition,boolean)

setTaggedValue

public void setTaggedValue(TagDefinition tagDef,
                           java.lang.String newValue)
Set the Stringtagged value stored in this element under a certain TagDefinition.

Parameters:
tagDef - the TagDefinition whose values are to be set - must support only single values, as defined by its TagDefinition.isMultiple() method
newValue - the additional value for this tag - must be a permitted value for the tagDef, as defined by its TagDefinition.isPermittedValue(java.lang.Object) method
See Also:
getTaggedValue(com.ashridgetech.jamda.uml.TagDefinition), setTaggedValues(com.ashridgetech.jamda.uml.TagDefinition, java.util.Collection), addTaggedValue(TagDefinition,String), setTaggedValue(TagDefinition,ModelElement), setTaggedValue(TagDefinition,boolean)

setTaggedValue

public void setTaggedValue(TagDefinition tagDef,
                           boolean newValue)
Set the ooleantagged value stored in this element under a certain TagDefinition.

Parameters:
tagDef - the TagDefinition whose values are to be set - must support only single values, as defined by its TagDefinition.isMultiple() method
newValue - the additional value for this tag - must be a permitted value for the tagDef, as defined by its TagDefinition.isPermittedValue(java.lang.Object) method
See Also:
getTaggedValue(com.ashridgetech.jamda.uml.TagDefinition), setTaggedValues(com.ashridgetech.jamda.uml.TagDefinition, java.util.Collection), setTaggedValue(TagDefinition,ModelElement), setTaggedValue(TagDefinition,String)

setTaggedValues

public void setTaggedValues(TagDefinition tagDef,
                            java.util.Collection newValues)
Set the tagged value(s) stored in this element under a certain TagDefinition. Clears the collection, then calls addTaggedValuesInternal(com.ashridgetech.jamda.uml.TagDefinition, java.util.Collection, boolean, boolean).

Parameters:
tagDef - the TagDefinition whose values are to be set
newValues - the new values for this tag - must be permitted values for the tagDef, as defined by its TagDefinition.isPermittedValue(java.lang.Object) method
See Also:
getTaggedValues(com.ashridgetech.jamda.uml.TagDefinition), addTaggedValues(com.ashridgetech.jamda.uml.TagDefinition, java.util.Collection)

getParentElement

public ModelElement getParentElement()
Get the ModelElement which contains this one, if any.

Returns:
the ModelElement, or null if there is no containing ModelElement

getChildElements

public java.util.List getChildElements()
Get all the ModelElements which this one contains.

Returns:
a List of ModelElements
See Also:
getParentElement()

getXpathContext

public org.apache.commons.jxpath.JXPathContext getXpathContext()
Get the XPath context for this ModelElement.

Returns:
the context
See Also:
xpath(java.lang.String)

xpath

public java.lang.Object xpath(java.lang.String expr)
Evaluate an XPath expression for a single object in the context returned by getXpathContext().

Parameters:
expr - the expression to evaluate
Returns:
the result of the evaluation - always a single object, never a collection

xpathList

public java.util.List xpathList(java.lang.String expr)
Evaluate an XPath expression for a list of objects in the context returned by getXpathContext().

Parameters:
expr - the expression to evaluate
Returns:
the result of the evaluation - may be empty, will never be null

getDirectSource

public ModelElement getDirectSource()
Get the ModelElement which was the immediate source for generating this one, if any.

Returns:
the ModelElement, or null if there is no source ModelElement

getOriginalSource

public ModelElement getOriginalSource()
Get the ModelElement which was the original source for generating this one, if any. This is found by following the chain of source elements until an element with no source is found.

Returns:
the original source ModelElement, or this element if there is no source ModelElement

setDirectSource

public void setDirectSource(ModelElement source)
Set the ModelElement which was the immediate source for generating this one, if any. This method may only be called once on each instance of this class.

Parameters:
source - the source ModelElement - may not be null
Throws:
IllegalStateException - if this method has already been called

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getElementType

public java.lang.String getElementType()
Get the name of the type of element.


isInitialised

public boolean isInitialised()
Show whether this element is fully initialised yet.


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.

Throws:
IllegalStateException - if a problem is found

tag

public TagDefinition tag(StandardTagDef tagDef)
Get a tag definition from the model using a standard definition.

Parameters:
tagDef - the StandardTagDef for the required TagDefinition

type

public DataType type(StandardDataTypeDef typeDef)
Get a DataType from the model using a standard definition.

Parameters:
typeDef - the StandardDataTypeDef for the required DataType

type

public ClassType type(StandardClassDef typeDef)
Get a ClassType from the model using a standard definition.

Parameters:
typeDef - the StandardClassDef for the required ClassType

type

public InterfaceType type(StandardInterfaceDef typeDef)
Get a InterfaceType from the model using a standard definition.

Parameters:
typeDef - the StandardInterfaceDef for the required InterfaceType

stereotype

public Stereotype stereotype(StandardStereotypeDef stereotypeDef)
Get a Stereotype from the model using a standard definition.

Parameters:
stereotypeDef - the StandardStereotypeDef for the required Stereotype

checkState

protected void checkState(boolean condition,
                          java.lang.String message)

checkInitialised

protected void checkInitialised()

getElement

protected ModelElement getElement(ru.novosoft.uml.foundation.core.MModelElement me)
Get the ModelElement which is the wrapper for a NSUML MModelElement. Looks it up in the Model using its XMI id and checks it exists.

Parameters:
me - the NSUML MModelElement which backs the desired element
Returns:
the element which wraps me
Throws:
IllegalStateException - if there is no wrapper element for me
See Also:
Model.getElementById(java.lang.String)

getNsElement

ru.novosoft.uml.foundation.core.MModelElement getNsElement()
Get the NSUML MModelElement which this object wraps, as set in the constructor. Package scope only.

Returns:
the NSUML element

findTaggedValueCollection

protected java.util.Collection findTaggedValueCollection(TagDefinition tagDef,
                                                         boolean create)
Get the tagged value collection stored in this element under a certain TagDefinition.

Parameters:
tagDef - the TagDefinition whose values are required
create - if true, a new tagged value collection is created if one does not already exist
Returns:
either the data value OR the reference value collection from the MTaggedValue, as appropriate to the MTagDefinition. If this element does not have a tag correpsonding to tagDef, return null.
Throws:
IllegalStateException - if the collections are not as expected

removeTaggedValue

protected void removeTaggedValue(TagDefinition tagDef)
Remove the tagged value stored in this element under a certain TagDefinition, if it exists.

Parameters:
tagDef - the TagDefinition whose values are to be removed If this element does not have a tag correpsonding to tagDef, there is no action.

addTaggedValuesInternal

protected void addTaggedValuesInternal(TagDefinition tagDef,
                                       java.util.Collection newValues,
                                       boolean multiple,
                                       boolean replace)
Add a new set of values to a tagged value collection, ensuring that they have the correct type.

Parameters:
tagDef - the TagDefinition whose values are to be set
newValues - the new values for this tag - may be empty, must not be null
multiple - if true, tagDef must allow multiple values
replace - if true, the new values replace the old ones

add

protected void add(ModelElement me)
Add a child element to this ModelElement.

Parameters:
me - The ModelElement to be added to the map Must not be null and its name property must not be null
Throws:
AssertionException - if mp does not belong to this ModelElement

getSubElementStore

protected ModelElement.ElementStore getSubElementStore(java.lang.Class meClass)
Must be overridden by subclasses to return the sub-element ModelElement.ElementStore into which an object of the class meClass should be stored, if they wish to store objects of this class. This implementation returns null, to indicate the object is not known.

Returns:
the store to use, DUMMY_STORE if the object is deliberately not stored, or null if the object is not known.

loadElement

protected ModelElement loadElement(ru.novosoft.uml.foundation.core.MModelElement element)
                            throws ModelElement.UnknownElementException
Return the appropriate ModelElement for the NSUML element being loaded. This implementation uses Model.createElement(ru.novosoft.uml.foundation.core.MModelElement, com.ashridgetech.jamda.uml.ModelElement).

Parameters:
element - the NSUML element
Returns:
the new ModelElement
Throws:
ModelElement.UnknownElementException - if no ModelElement can be created for element, unless the element is a tagged value
ModelElement.UnknownElementException

load

protected void load()

load

protected void load(java.util.Collection c,
                    java.lang.String description)
Load all the MModelElements of a given collection. Calls loadElement(ru.novosoft.uml.foundation.core.MModelElement) for each one.

Parameters:
c - the MModelElements to load
description - description of the MModelElements to load

load

protected void load(java.util.Collection c,
                    java.lang.String description,
                    java.lang.Class elementClass)
Load the MModelElements of a given collection, choosing those which are instances of a certain class. Calls loadElement(ru.novosoft.uml.foundation.core.MModelElement) for each one.

Parameters:
c - the MModelElements to load
description - description of the MModelElements to load
elementClass - the class of the MModelElements to load, or null to load all elements in the collection

logger

protected org.apache.log4j.Logger logger()

logger

protected static org.apache.log4j.Logger logger(java.lang.Class c)

tagError

protected java.lang.String tagError(java.lang.String description,
                                    TagDefinition tagDef,
                                    java.util.Collection tagColl)
Utility method to get an error message for a tag-related error.

Parameters:
description - description of the problem
tagDef - the TagDefinition concerned
tagColl - the collection of tagged values
Returns:
the full message


Copyright © 2003 Ashridge Technologies Ltd. All Rights Reserved.