Package com.ashridgetech.jamda.code

Classes for generating code, principally from UML metamodel elements.


Class Summary
ClassGenerator Java code generator to generate a Java class.
ClassWriter A JavaWriter extended with methods for writing class structural elements.
ClassWriter.MethodDetails Collects the details of a method in the code.
CodeWriter Provides services for writing program code to a Writer.
JavaWriter A CodeWriter specialised to write Java code.
MethodCoder Base class for classes which write the code for Java method bodies.
MethodCoderFactory Base class for factory classes which create MethodCoders.
OperationMethodCoder Writes the method code using an Operation's procedure.
UmlClassGenerator Code generator which generates a Java class with the exact features of a UML ClassType.
UmlInterfaceGenerator Code generator which generates a Java interface with the exact features of a UML InterfaceType.
UmlTypeGenerator Superclass for Java code generators which generate a Java class or interface with features corresponding to those of a StructuredType.

Package com.ashridgetech.jamda.code Description

Classes for generating code, principally from UML metamodel elements.

Overall Structure

The classes in this package are designed in layers that build on one another, but which can all be reused independently if required. The most basic level is CodeWriter, which is used by JavaWriter, which is in turn used by ClassWriter to provide all the facilities for writing the code features of a Java class. ClassGenerator uses a ClassWriter to write the features of the Java class with which it is configured. UmlTypeGenerator extends ClassGenerator and configures its class features from a StructuredType in a UML Model. UmlClassGenerator and UmlInterfaceGenerator are specific extensions of UmlTypeGenerator for generating classes and interfaces.

Generating code for methods

MethodCoder and associated classes are used by UmlClassGenerator to create code for the method bodies. The UmlClassGenerator may be configured with MethodCoderFactory objects that generate code for Operations with specific names or Stereotypes. The default is to use an OperationMethodCoder, which generates the code set for the Operation by setProcedure.

Copyright © 2003 Ashridge Technologies Ltd. All Rights Reserved.