com.ashridgetech.jamda.uml
Class TagDefinition

java.lang.Object
  |
  +--com.ashridgetech.jamda.uml.ModelElement
        |
        +--com.ashridgetech.jamda.uml.TagDefinition

public class TagDefinition
extends ModelElement

A UML Tag Definition. Referenced by various other UML metamodel classes.

Version:
1.0
Author:
paulb

Nested Class Summary
static class TagDefinition.TagType
          Type-safe enumeration for the allowable tag types.
 
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.ModelElement
DUMMY_STORE
 
Constructor Summary
  TagDefinition(Model model, java.lang.String name, TagDefinition.TagType tagType, int lowerMultiplicity, int upperMultiplicity)
          Creates new TagDefinition belonging to the Model.
protected TagDefinition(Model model, java.lang.String name, TagDefinition.TagType tagType, int lowerMultiplicity, int upperMultiplicity, Stereotype owner)
          Creates new TagDefinition with a new NSUML MTagDefinition object.
protected TagDefinition(ru.novosoft.uml.foundation.core.MTagDefinition ms, ModelElement parent)
          Creates new TagDefinition from a NSUML MTagDefinition object.
  TagDefinition(Stereotype owner, java.lang.String name, TagDefinition.TagType tagType, int lowerMultiplicity, int upperMultiplicity)
          Creates new TagDefinition belonging to a Stereotype.
 
Method Summary
 void checkValid()
          Check whether this object is valid.
 java.lang.String getClassNameForTagType()
          Get the full class name for the class in the com.ashridgetech.jamda.uml package, or (or Boolean or String) which corresponds to a tag type name.
 java.lang.String getDescription()
          Get a description of this element for logging, which includes the stereotype name if it has one
 int getLowerMultiplicity()
          Get the lower multiplicity of this TagDefinition.
 Stereotype getOwnerStereotype()
          Get the Stereotype to which this TagDefinition belongs, if any.
 TagDefinition.TagType getTagType()
          Get the type of this TagDefinition.
 java.lang.Class getType()
          Get the type from the com.ashridgetech.jamda.uml package, (or Boolean or String) which is contained by tagged values with this TagDefinition.
 int getUpperMultiplicity()
          Get the upper multiplicity of this TagDefinition.
 boolean isBooleanType()
          Shows whether this TagDefinition is for a boolean value.
 boolean isMultiple()
          Indicate whether this TagDefinition can have multiple values.
 boolean isPermittedValue(java.lang.Object value)
          Show whether a given value is legal for this TagDefinition.
 boolean isReferenceType()
          Shows whether this TagDefinition holds references to model elements.
 boolean isStringType()
          Shows whether this TagDefinition is for String value(s).
 
Methods inherited from class com.ashridgetech.jamda.uml.ModelElement
add, addStereotype, addTaggedValue, addTaggedValue, addTaggedValues, addTaggedValuesInternal, checkInitialised, checkState, findTaggedValueCollection, getBooleanTaggedValue, getChildElements, getComment, getDirectSource, getElement, getElementType, getFullName, getId, getModel, getName, getNsElement, getOriginalSource, getParentElement, getProperties, getStereotypes, getStringTaggedValue, getSubElementStore, getTaggedValue, getTaggedValues, getXpathContext, hasStereotype, hasTaggedValue, init, initLoad, isInitialised, load, 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

TagDefinition

public TagDefinition(Model model,
                     java.lang.String name,
                     TagDefinition.TagType tagType,
                     int lowerMultiplicity,
                     int upperMultiplicity)
Creates new TagDefinition belonging to the Model.

Parameters:
model - the Model to which the definition belongs
name - the name of this definition
tagType - the type of the UML model element, or String or Boolean, to which the tag applies * @param lowerMultiplicity the lowest number of tagged values for this tag
upperMultiplicity - the greatest number of tagged values for this tag belongs - may be null for a tag not attached to a Stereotype

TagDefinition

public TagDefinition(Stereotype owner,
                     java.lang.String name,
                     TagDefinition.TagType tagType,
                     int lowerMultiplicity,
                     int upperMultiplicity)
Creates new TagDefinition belonging to a Stereotype.

Parameters:
owner - the Stereotype to which this TagDefinition belongs - may not be null
name - the name of this definition
tagType - the type of the UML model element, or String or Boolean, to which the tag applies * @param lowerMultiplicity the lowest number of tagged values for this tag
upperMultiplicity - the greatest number of tagged values for this tag

TagDefinition

protected TagDefinition(Model model,
                        java.lang.String name,
                        TagDefinition.TagType tagType,
                        int lowerMultiplicity,
                        int upperMultiplicity,
                        Stereotype owner)
Creates new TagDefinition with a new NSUML MTagDefinition object.

Parameters:
model - the Model to which the definition belongs
name - the name of this definition
tagType - the type of the UML model element, or String or Boolean, to which the tag applies
lowerMultiplicity - the lowest number of tagged values for this tag
upperMultiplicity - the greatest number of tagged values for this tag
owner - the Stereotype to which this TagDefinition belongs - may be null for a tag not attached to a Stereotype

TagDefinition

protected TagDefinition(ru.novosoft.uml.foundation.core.MTagDefinition ms,
                        ModelElement parent)
Creates new TagDefinition from a NSUML MTagDefinition object.

Method Detail

getOwnerStereotype

public Stereotype getOwnerStereotype()
Get the Stereotype to which this TagDefinition belongs, if any.

Returns:
the Stereotype, or null if this TagDefinition belongs to the Model

getTagType

public TagDefinition.TagType getTagType()
Get the type of this TagDefinition.

Returns:
the type

getLowerMultiplicity

public int getLowerMultiplicity()
Get the lower multiplicity of this TagDefinition.

Returns:
the lower bound of the multiplicity

isMultiple

public boolean isMultiple()
Indicate whether this TagDefinition can have multiple values. Uses the rules of NSUtil.isMultiple(ru.novosoft.uml.foundation.data_types.MMultiplicity)

Returns:
true if multiple values are possible

getUpperMultiplicity

public int getUpperMultiplicity()
Get the upper multiplicity of this TagDefinition.

Returns:
the upper bound of the multiplicity

isBooleanType

public boolean isBooleanType()
Shows whether this TagDefinition is for a boolean value.

Returns:
true if this TagDefinition is for a boolean value

isStringType

public boolean isStringType()
Shows whether this TagDefinition is for String value(s).

Returns:
true if this TagDefinition is for String values

isReferenceType

public boolean isReferenceType()
Shows whether this TagDefinition holds references to model elements.

Returns:
true if this TagDefinition has reference values, false if it has data values

isPermittedValue

public boolean isPermittedValue(java.lang.Object value)
Show whether a given value is legal for this TagDefinition.

Parameters:
value - the Object to test
Returns:
true if value is a legal value for this tag

getType

public java.lang.Class getType()
Get the type from the com.ashridgetech.jamda.uml package, (or Boolean or String) which is contained by tagged values with this TagDefinition.

Returns:
the Class of the contained type

getClassNameForTagType

public java.lang.String getClassNameForTagType()
Get the full class name for the class in the com.ashridgetech.jamda.uml package, or (or Boolean or String) which corresponds to a tag type name.

Returns:
the class name

getDescription

public java.lang.String getDescription()
Get a description of this element for logging, which includes the stereotype name if it has one

Overrides:
getDescription in class ModelElement

checkValid

public void checkValid()
                throws java.lang.IllegalStateException
Check whether this object is valid. Ensure that the NSUML tag type matches the name of the stored TagType

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


Copyright © 2003 Ashridge Technologies Ltd. All Rights Reserved.