|
|||||||||||
| 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
|
+--com.ashridgetech.jamda.uml.ClassType
A UML Class.
| Nested Class Summary |
| Nested classes inherited from class com.ashridgetech.jamda.uml.StructuredType |
StructuredType.Aggregation, StructuredType.PropertyImpl, StructuredType.Visibility |
| 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.StructuredType |
READ_ONLY, UNBOUNDED, WRITABLE |
| Fields inherited from class com.ashridgetech.jamda.uml.ModelElement |
DUMMY_STORE |
| Constructor Summary | |
protected |
ClassType(ru.novosoft.uml.foundation.core.MClass mc,
ModelPackage parentPackage)
Initialises new ClassType during loading. |
|
ClassType(ModelPackage parentPackage,
java.lang.String name)
Creates new ClassType belonging to a ModelPackage. |
| Method Summary | |
ClassType |
addInterface(InterfaceType type)
Add an InterfaceType which this ClassType implements. |
Property |
addProperty(java.lang.String name,
Type type,
boolean writable,
java.lang.String comment,
ModelElement source)
Add a property to this StructuredType. |
void |
checkValid()
Check whether this object is valid. |
java.util.Collection |
getAssociationEnds()
Get the Association.Ends at the other end
of Associations from this ClassType. |
Attribute |
getAttribute(ModelElement source)
Get the single Attribute of this StructuredType with a given source ModelElement |
Attribute |
getAttribute(Stereotype stereotype,
ModelElement source)
Get the single Attribute of this StructuredType with a given
Stereotype and source ModelElement. |
Attribute |
getAttribute(java.lang.String name)
Get the Attribute of this ClassType with a given name |
java.util.List |
getAttributes()
Get the Attributes of this ClassType. |
java.util.List |
getAttributes(ModelElement element)
Get the Attribute(s) of this ClassType which have the same original source ModelElement
as a given element, or whose direct source is the element. |
java.util.List |
getAttributes(Stereotype stereotype)
Get the Attribute(s) of this StructuredType with a given Stereotype |
java.util.List |
getAttributes(Stereotype stereotype,
ModelElement source)
Get the Attribute(s) of this StructuredType with a given
Stereotype and source ModelElement |
java.util.List |
getConstructors()
Get the Constructors of this ClassType. |
java.util.Collection |
getInterfaces()
Get the InterfaceTypes which this ClassType implements. |
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. |
ClassType |
getSuperClass()
Get the one ClassType which is the superclass of this one, if there is one
other than java.lang.Object. |
(package private) void |
invalidate(ModelElement changedObject)
Inform this object that its cached details may be out of date. |
boolean |
isAbstract()
Show whether this ClassType is abstract. |
boolean |
isSimple()
Show whether this Type is a simple type, such as a number
or String , or composed of other parts. |
protected java.util.List |
makeProperties()
Return a list of ModelElements
which implement the Property interface. |
protected StructuredType.PropertyImpl |
makeProperty(Operation getter)
Make one StructuredType.PropertyImpl from an Operation. |
java.lang.String |
propertyInitCode(Operation operation)
Create the property initialisation code in Java for an Operation . |
ClassType |
setAbstract(boolean isAbstract)
Set whether this ClassType is abstract. |
ClassType |
setSuperClass(ClassType superclass)
Set the one ClassType which is the superclass of this one, if there is one
other than java.lang.Object. |
ClassType |
setVisibility(StructuredType.Visibility visibility)
Set the visibility of this ClassType. |
| Methods inherited from class com.ashridgetech.jamda.uml.StructuredType |
addProperties, addReadOnlyProperty, addSuperType, addWritableProperty, getAllProperties, getAllTaggedValues, getOperation, getOperation, getOperations, getOperations, getOperations, getOperations, getOperations, getParentPackage, getProperties, getProperty, getSubTypes, getSuperTypes, getVisibility, load, setStructuredTypeVisibility |
| 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 |
| Constructor Detail |
public ClassType(ModelPackage parentPackage,
java.lang.String name)
ModelPackage.
protected ClassType(ru.novosoft.uml.foundation.core.MClass mc,
ModelPackage parentPackage)
| Method Detail |
public boolean isAbstract()
ClassType is abstract.
public ClassType setAbstract(boolean isAbstract)
ClassType is abstract.
isAbstract - true if this is to be abstract
public ClassType setVisibility(StructuredType.Visibility visibility)
ClassType.
visibility - the Visibility instance representing
this ClassType's visibility - must not be null
public ClassType getSuperClass()
ClassType which is the superclass of this one, if there is one
other than java.lang.Object.
java.lang.IllegalStateException - if there is more than one superclasspublic ClassType setSuperClass(ClassType superclass)
ClassType which is the superclass of this one, if there is one
other than java.lang.Object. The superclass must not already have been set, and it cannot
be removed by setting a null superclass.
superclass - the superclass to set for this ClassType - must not be null
java.lang.IllegalStateException - if there is already a superclasspublic java.util.Collection getInterfaces()
InterfaceTypes which this ClassType implements.
InterfaceType objectspublic java.util.List getAttributes(Stereotype stereotype)
Attribute(s) of this StructuredType with a given Stereotype
stereotype - the stereotype of the required Attribute(s)
Attributes whose stereotype is stereotype,
which may be empty if there are no Attributes with that stereotypepublic java.util.List getAttributes(ModelElement element)
Attribute(s) of this ClassType 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 Attribute(s) are found - may not be null
Attributes found,
which may be empty if there are no Attributes with that sourceModelElement.getOriginalSource(),
ModelElement.getDirectSource()public Attribute getAttribute(ModelElement source)
Attribute of this StructuredType with a given source ModelElement
source - the source element of the required Attribute(s)
Attribute found,
or null if there is no Attribute with the given source
java.lang.IllegalStateException - if there is more than one Attribute with the given source
public java.util.List getAttributes(Stereotype stereotype,
ModelElement source)
Attribute(s) of this StructuredType with a given
Stereotype and source ModelElement
stereotype - the stereotype of the required Attribute(s)source - the source element of the required Attribute(s)
Attributes ,
which may be empty
public Attribute getAttribute(Stereotype stereotype,
ModelElement source)
Attribute of this StructuredType with a given
Stereotype and source ModelElement.
stereotype - the stereotype of the required Attributesource - the source element of the required Attribute
Attribute found,
or null if there is no Attribute with the given source and stereotype
java.lang.IllegalStateException - if there is more than one Attribute with the given source and stereotypepublic ClassType addInterface(InterfaceType type)
InterfaceType which this ClassType implements.
type - the new interface which this ClassType implements
- must not already be one of the interfaces implemented
java.lang.IllegalArgumentException - if type is already implemented
by this ClassTypegetInterfaces()
public Property addProperty(java.lang.String name,
Type type,
boolean writable,
java.lang.String comment,
ModelElement source)
StructuredType.
addProperty in class StructuredTypename - 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 StructuredType.READ_ONLY
and StructuredType.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 null
StructuredType.addProperty(java.lang.String, com.ashridgetech.jamda.uml.Type, boolean, java.lang.String, com.ashridgetech.jamda.uml.ModelElement)public java.util.List getConstructors()
Constructors of this ClassType.
Constructor objects, in the order
in which they are defined in the model.public java.util.List getAttributes()
Attributes of this ClassType.
Attribute objects, in the order
in which they are defined in the model.public Attribute getAttribute(java.lang.String name)
Attribute of this ClassType with a given name
name - the name of the required Attribute
Attribute whose name is name,
or null if there is no such objectpublic java.util.Collection getAssociationEnds()
Association.Ends at the other end
of Associations from this ClassType.
Association.End objects.public java.lang.String propertyInitCode(Operation operation)
Operation .
Assigns each Parameter with the UmlStereotypes.PROPERTY_SETTER stereotype
to the Attribute with the same original source element.
If there is no Attribute with the same source element, and the class which contains
operation has a superclass, that parameter value is passed to the superclass
in a super() call.
operation - the Operation for which the code is needed
java.lang.IllegalStateException - if there is no Attribute to which a parameter
value may be assigned
java.lang.IllegalArgumentException - if the owner of this Operation is not
this ClassType
public void checkValid()
throws java.lang.IllegalStateException
checkValid in class StructuredTypejava.lang.IllegalStateException - if a problem is foundpublic boolean isSimple()
Type is a simple type, such as a number
or String , or composed of other parts.
isSimple in class StructuredTypejava.lang or the full name is java.util.Date,
false otherwiseprotected java.util.List makeProperties()
ModelElements
which implement the Property interface.
makeProperties in class StructuredTypeStructuredType.protected StructuredType.PropertyImpl makeProperty(Operation getter)
StructuredType.PropertyImpl from an Operation.
makeProperty in class StructuredTypeprotected ModelElement.ElementStore getSubElementStore(java.lang.Class meClass)
ModelElement.ElementStore
into which an object of the class meClass should be stored.
getSubElementStore in class StructuredTypevoid invalidate(ModelElement changedObject)
invalidate in class StructuredTypechangedObject - 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 | ||||||||||