|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ashridgetech.jamda.uml.ModelElement | +--com.ashridgetech.jamda.uml.Type | +--com.ashridgetech.jamda.uml.StructuredType
The base class for non-primitive UML types.
Nested Class Summary | |
static class |
StructuredType.Aggregation
Typesafe enum to represent the aggregation of Association.End s
and Attribute s in a type. |
protected static class |
StructuredType.PropertyImpl
Implementation of the Property interface for a getter and/or setter Operation . |
static class |
StructuredType.Visibility
Typesafe enum to represent the visibility of Operation s
and Attribute s in a type. |
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 | |
static boolean |
READ_ONLY
|
static int |
UNBOUNDED
Represents an unbounded multiplicity limit by a value of -1. |
static boolean |
WRITABLE
|
Fields inherited from class com.ashridgetech.jamda.uml.ModelElement |
DUMMY_STORE |
Constructor Summary | |
protected |
StructuredType(ru.novosoft.uml.foundation.core.MClassifier mc,
ModelPackage parentPackage)
Initialises new StructuredType during loading. |
Method Summary | |
java.util.List |
addProperties(java.util.Collection newProperties,
java.lang.Boolean isWritable)
Add properties corresponding to a Collection of input properties. |
Property |
addProperty(java.lang.String name,
Type type,
boolean writable,
java.lang.String comment,
ModelElement source)
Add a property to this StructuredType . |
Property |
addReadOnlyProperty(ModelElement source,
java.lang.String name,
Type type)
Add a read-only property to this StructuredType . |
StructuredType |
addSuperType(StructuredType supertype)
Add a StructuredType which is a supertype of this one, if there is one
other than java.lang.Object. |
Property |
addWritableProperty(ModelElement source,
java.lang.String name,
Type type)
Add a writable property to this StructuredType . |
void |
checkValid()
Check whether this object is valid. |
java.util.List |
getAllProperties()
Get the Property s of this StructuredType and its supertypes. |
java.util.Collection |
getAllTaggedValues(TagDefinition tagDef)
Get the tagged value(s) stored in this StructuredType and its supertypes
under a certain TagDefinition . |
Operation |
getOperation(Stereotype stereotype,
ModelElement element)
Get the single Operation of this StructuredType with a given with a given
Stereotype and the same original source as a given ModelElement . |
Operation |
getOperation(java.lang.String name)
Get the single Operation of this StructuredType with a given name. |
java.util.List |
getOperations()
Get the Operation s of this StructuredType . |
java.util.List |
getOperations(ModelElement element)
Get the Operation (s) of this StructuredType which have the same original source ModelElement
as a given element , or whose direct source is the element. |
java.util.List |
getOperations(Stereotype stereotype)
Get the Operation (s) of this StructuredType with a given Stereotype |
java.util.List |
getOperations(Stereotype stereotype,
ModelElement source)
Get the Operation (s) of this StructuredType with a given
Stereotype and source ModelElement |
java.util.List |
getOperations(java.lang.String name)
Get the Operation (s) of this StructuredType with a given name |
ModelPackage |
getParentPackage()
Get the Package which contains this StructuredType . |
java.util.List |
getProperties()
Get the Property s of this StructuredType . |
Property |
getProperty(java.lang.String name)
Get the single Property of this StructuredType with a given name. |
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. |
java.util.Collection |
getSubTypes()
Get the StructuredType s which are subtypes of this one. |
java.util.Collection |
getSuperTypes()
Get the StructuredType s which are supertypes of this one. |
StructuredType.Visibility |
getVisibility()
Get the visibility of this StructuredType . |
(package private) void |
invalidate(ModelElement changedObject)
Inform this object that its cached details may be out of date. |
boolean |
isSimple()
Show whether this Type is a simple type, such as a number
or String , or composed of other parts. |
protected void |
load()
|
protected java.util.List |
makeProperties()
Creates Property s for the getter and setter operations in this StructuredType . |
protected StructuredType.PropertyImpl |
makeProperty(Operation getter)
Make one StructuredType.PropertyImpl from an Operation . |
protected StructuredType |
setStructuredTypeVisibility(StructuredType.Visibility visibility)
Set the visibility of this StructuredType . |
Methods inherited from class com.ashridgetech.jamda.uml.ModelElement |
add, 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 |
Field Detail |
public static final boolean READ_ONLY
public static final boolean WRITABLE
public static final int UNBOUNDED
Constructor Detail |
protected StructuredType(ru.novosoft.uml.foundation.core.MClassifier mc, ModelPackage parentPackage)
Method Detail |
public ModelPackage getParentPackage()
StructuredType
.
public StructuredType.Visibility getVisibility()
StructuredType
.
protected StructuredType setStructuredTypeVisibility(StructuredType.Visibility visibility)
StructuredType
.
visibility
- the new visibility - must not be nullpublic java.util.Collection getSuperTypes()
StructuredType
s which are supertypes of this one.
StructuredType
objectspublic StructuredType addSuperType(StructuredType supertype)
StructuredType
which is a supertype of this one, if there is one
other than java.lang.Object. A StructuredType
which is already
a supertype of this cannot be added again.
supertype
- the supertype to add to this StructuredType
- must not be null
java.lang.IllegalStateException
- if supertype
is already a supertype of thispublic Property addReadOnlyProperty(ModelElement source, java.lang.String name, Type type)
StructuredType
. Calls addProperty(java.lang.String, com.ashridgetech.jamda.uml.Type, boolean, java.lang.String, com.ashridgetech.jamda.uml.ModelElement)
.
name
- the name of the propertytype
- the type of the property
addProperty(java.lang.String, com.ashridgetech.jamda.uml.Type, boolean, java.lang.String, com.ashridgetech.jamda.uml.ModelElement)
public Property addWritableProperty(ModelElement source, java.lang.String name, Type type)
StructuredType
. Calls addProperty(java.lang.String, com.ashridgetech.jamda.uml.Type, boolean, java.lang.String, com.ashridgetech.jamda.uml.ModelElement)
.
name
- the name of the propertytype
- the type of the property
addProperty(java.lang.String, com.ashridgetech.jamda.uml.Type, boolean, java.lang.String, com.ashridgetech.jamda.uml.ModelElement)
public Property addProperty(java.lang.String name, Type type, boolean writable, java.lang.String comment, ModelElement source)
StructuredType
.
name
- the name of the property - must not be null or emptytype
- the type of the property - must not be nullwritable
- true if the property is writable. Use the constants READ_ONLY
and WRITABLE
for clarity.comment
- the description of the property - if null, will use the comment
from source
, if that is not nullsource
- the source of this property - may be operations
Property.getSetter()
will be null if writable
is false, and Property.getAttribute()
will always be nullpublic java.util.List addProperties(java.util.Collection newProperties, java.lang.Boolean isWritable)
Collection
of input properties.
newProperties
- the Property
s that define the new ones to be added
Property
s addedpublic java.util.Collection getSubTypes()
StructuredType
s which are subtypes of this one.
StructuredType
objectspublic java.util.List getProperties()
Property
s of this StructuredType
.
Calls makeProperties()
the first time it is called.
Property
public java.util.List getAllProperties()
Property
s of this StructuredType
and its supertypes.
Property
public Property getProperty(java.lang.String name)
Property
of this StructuredType
with a given name.
This implementation calls getProperties()
to ensure the properties list is built.
name
- the name of the required Property
Property
whose name is name
,
or null if there is no Property
with that namepublic java.util.List getOperations()
Operation
s of this StructuredType
.
Operation
objects, in the order
in which they are defined in the model.public java.util.List getOperations(java.lang.String name)
Operation
(s) of this StructuredType
with a given name
name
- the name of the required Operation
(s)
Operation
s whose name is name
,
which may be empty if there are no Operation
s with that namepublic Operation getOperation(java.lang.String name)
Operation
of this StructuredType
with a given name.
name
- the name of the required Operation
Operation
whose name is name
,
or null if there is no Operation
with that name
java.lang.IllegalStateException
- if there is more than one Operation
with name
public java.util.List getOperations(Stereotype stereotype)
Operation
(s) of this StructuredType
with a given Stereotype
stereotype
- the stereotype of the required Operation
(s)
Operation
s whose stereotype is stereotype
,
which may be empty if there are no Operation
s with that stereotypepublic java.util.List getOperations(ModelElement element)
Operation
(s) of this StructuredType
which have the same original source
ModelElement
as a given element
, or whose direct source
is the element.
element
- the element for which the required Operation
(s) are found - may not be null
Operation
s found,
which may be empty if there are no Operation
s with that sourceModelElement.getOriginalSource()
,
ModelElement.getDirectSource()
public java.util.List getOperations(Stereotype stereotype, ModelElement source)
Operation
(s) of this StructuredType
with a given
Stereotype
and source ModelElement
stereotype
- the stereotype of the required Operation
(s)source
- the source element of the required Operation
(s)
Operation
s ,
which may be emptypublic Operation getOperation(Stereotype stereotype, ModelElement element)
Operation
of this StructuredType
with a given with a given
Stereotype
and the same original source as a given ModelElement
.
stereotype
- the stereotype of the required Operation
element
- the element with the same original source element as the required Operation
Operation
found,
or null if there is no Operation
with the given source and stereotype
java.lang.IllegalStateException
- if there is more than one Operation
with the given source and stereotypepublic java.util.Collection getAllTaggedValues(TagDefinition tagDef)
StructuredType
and its supertypes
under a certain TagDefinition
.
tagDef
- the TagDefinition
whose values are required
Object
s. If this element,
and all its supertypes, do
not have a tag corresponding to tagDef
, returns an empty collection.
If tagDef
's TagDefinition.isReferenceType()
method returns true
,
the collection contains the ModelElement
s referred to by the tagged values,
otherwise the actual String
or Boolean
values.ModelElement.getTaggedValues(com.ashridgetech.jamda.uml.TagDefinition)
public boolean isSimple()
Type
is a simple type, such as a number
or String
, or composed of other parts.
isSimple
in class Type
StructuredType
- this method may be overridden by subclassespublic void checkValid() throws java.lang.IllegalStateException
checkValid
in class ModelElement
java.lang.IllegalStateException
- if a problem is foundprotected java.util.List makeProperties()
Property
s for the getter and setter operations in this StructuredType
.
May be overridden by subclasses to return a list of their ModelElement
s
which implement the Property
interface. An overriding method should
call super.makeProperties
and return a combined list.
Property
objectsprotected StructuredType.PropertyImpl makeProperty(Operation getter)
StructuredType.PropertyImpl
from an Operation
.
protected ModelElement.ElementStore getSubElementStore(java.lang.Class meClass)
ModelElement.ElementStore
into which an object of the class meClass
should be stored.
getSubElementStore
in class ModelElement
protected void load()
load
in class ModelElement
void invalidate(ModelElement changedObject)
changedObject
- the new or modified object which may affect this one
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |