com.ashridgetech.jamda.transform
Class UmlClassCreator

java.lang.Object
  |
  +--com.ashridgetech.jamda.transform.UmlTypeCreator
        |
        +--com.ashridgetech.jamda.transform.UmlClassCreator
All Implemented Interfaces:
ElementTransformer

public abstract class UmlClassCreator
extends UmlTypeCreator

Generates a new ClassType from a given source StructuredType. Each instance may only be used to generate one element. Subclasses must implement UmlTypeCreator.setup() and UmlTypeCreator.standardElementDefClasses(). They may wish to override makeNewClass(), UmlTypeCreator.getNewName() or UmlTypeCreator.getPackage().

Author:
Paul Boocock version 1.0

Nested Class Summary
 
Nested classes inherited from class com.ashridgetech.jamda.transform.UmlTypeCreator
UmlTypeCreator.PropertyDetails
 
Constructor Summary
UmlClassCreator()
          Construct a UmlClassCreator for a Java class.
 
Method Summary
protected  Attribute addAttribute(java.lang.String name, Type type)
          Make a new Attribute belonging to the new class.
protected  Constructor addConstructor()
          Make a new Constructor belonging to the new class.
protected  UmlTypeCreator.PropertyDetails addProperty(Property property)
          Make a new single or pair of Operations belonging to the new type, which are getter and setter (if writable) for a property.
protected  UmlTypeCreator.PropertyDetails addProperty(Property property, boolean createAttribute)
          Make a new single or pair of Operations belonging to the new type, which are getter and setter (if writable) for a property.
 ClassType getNewClass()
          Get the new ClassType being created.
protected  ClassType makeNewClass()
          Make a new ClassType element.
protected  StructuredType makeNewType()
          {@inheritDoc}
 java.lang.String toString()
           
 
Methods inherited from class com.ashridgetech.jamda.transform.UmlTypeCreator
addOperation, addOperation, addOperation, checkReadyToCreate, extraStandardDefClasses, getModel, getNewName, getNewType, getPackage, getPackageName, getSource, getSuffix, logChange, logCreate, logger, setModel, setPackageName, setSource, setSuffix, setup, standardElementDefClasses, transform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UmlClassCreator

public UmlClassCreator()
Construct a UmlClassCreator for a Java class.

Method Detail

getNewClass

public ClassType getNewClass()
Get the new ClassType being created. Only valid after UmlTypeCreator.transform(com.ashridgetech.jamda.uml.ModelElement) has called makeNewType().

Returns:
the new element

makeNewType

protected final StructuredType makeNewType()
{@inheritDoc}

Specified by:
makeNewType in class UmlTypeCreator
Returns:
the new element.

makeNewClass

protected ClassType makeNewClass()
Make a new ClassType element. This implementation creates a new ClassType belonging to the package returned by UmlTypeCreator.getPackage(), with the name returned by UmlTypeCreator.getNewName().

Returns:
the new element.

addAttribute

protected Attribute addAttribute(java.lang.String name,
                                 Type type)
Make a new Attribute belonging to the new class. The new Attribute is returned so further characteristics can be set.

Parameters:
name - the name of this Attribute
type - the type of this Attribute
Returns:
the new Attribute

addConstructor

protected Constructor addConstructor()
Make a new Constructor belonging to the new class. The new Constructor is returned so further characteristics can be set.

Returns:
the new Constructor

toString

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

addProperty

protected UmlTypeCreator.PropertyDetails addProperty(Property property,
                                                     boolean createAttribute)
Make a new single or pair of Operations belonging to the new type, which are getter and setter (if writable) for a property. The new Operations are returned in a UmlTypeCreator.PropertyDetails so further characteristics can be set if required. Also create an Attribute if createAttribute is true

Parameters:
property - the Property from which the features are created
createAttribute - if true, an attribute is created for this property
Returns:
the new property details .

addProperty

protected UmlTypeCreator.PropertyDetails addProperty(Property property)
Make a new single or pair of Operations belonging to the new type, which are getter and setter (if writable) for a property. The new Operations are returned in a UmlTypeCreator.PropertyDetails so further characteristics can be set if required. Also create an Attribute.

Overrides:
addProperty in class UmlTypeCreator
Parameters:
property - the Property from which the features are created
Returns:
the new property details .


Copyright © 2003 Ashridge Technologies Ltd. All Rights Reserved.