implementations
Class JavaOverrides

java.lang.Object
  |
  +--implementations.JavaImplementationGenerator
        |
        +--implementations.JavaOverrides
All Implemented Interfaces:
ImplementationGeneratorI
Direct Known Subclasses:
ConcernJOverrides, SEESCOAOverrides

public class JavaOverrides
extends JavaImplementationGenerator

Implementation generator plugin class for implementing a Overrides composite in Java.

Version:
0.1.06, 4 February 2003
Author:
Dennis Wagelaar

Constructor Summary
JavaOverrides()
          Constructs a JavaOverrides
 
Method Summary
 void apply(ImplementationGenerator implementation, GenerateImplementationVisitor generateImpl)
          Applies the implementation generator.
protected  void applyPerNewMethod()
          Applies the implementation generator for each NewMethod concept.
protected  void applyToNewMethod(Concept newMethod, java.util.Collection oldMethods)
          Applies the implementation generator to an NewMethod concept.
protected  void checkOldMethodsCount(java.util.Collection oldMethods)
          Checks whether the amount of OldMethod concepts doesn't exceed 1.
PRE: oldMethods ::= Collectio<Concept>
protected  void checkRoles()
          Checks the composite roles for existence.
protected  CompositeRole getNewMethodRole()
          Retrieves the NewMethod role of the composite.
protected  CompositeRole getOldMethodRole()
          Retrieves the OldMethod role of the composite.
 
Methods inherited from class implementations.JavaImplementationGenerator
createClause, createMethod, getClasses, getComposite, getConceptsFor, getCurrentImplementation, getCurrentImplementation, getImplGen, getInstanceName, getInterfaces, getModel, getPrimitives, getVisitor, insertImports, insertInheritance, insertMethod, insertMethodOverrideID, insertParameters, insertPrimitiveImplementation, insertPrimitiveImplementations, insertReturnType, insertVariables, isClass, isInterface, isMethod, isPrimitive, isStatic, lcfirst, setCurrentImplementation, setCurrentImplementation, ucfirst
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaOverrides

public JavaOverrides()
Constructs a JavaOverrides
Method Detail

getOldMethodRole

protected CompositeRole getOldMethodRole()
Retrieves the OldMethod role of the composite.
Returns:
The OldMethod CompositeRole.

getNewMethodRole

protected CompositeRole getNewMethodRole()
Retrieves the NewMethod role of the composite.
Returns:
The NewMethod CompositeRole.

checkRoles

protected void checkRoles()
                   throws CoComposeException
Checks the composite roles for existence.
Throws:
CoComposeException - if a required role does not exist.

checkOldMethodsCount

protected void checkOldMethodsCount(java.util.Collection oldMethods)
                             throws CoComposeException
Checks whether the amount of OldMethod concepts doesn't exceed 1.
PRE: oldMethods ::= Collectio<Concept>
Parameters:
oldMethods - The collection of OldMethod concepts.
Throws:
CoComposeException - if the amount exceeds 1.

applyPerNewMethod

protected void applyPerNewMethod()
                          throws CoComposeException
Applies the implementation generator for each NewMethod concept.
Throws:
CoComposeException - if generating implementation failed.

applyToNewMethod

protected void applyToNewMethod(Concept newMethod,
                                java.util.Collection oldMethods)
                         throws CoComposeException
Applies the implementation generator to an NewMethod concept.
Parameters:
newMethod - The concept to apply the role part for.
oldMethods - The set of oldMethod concepts.
Throws:
CoComposeException - if generating implementation failed.

apply

public void apply(ImplementationGenerator implementation,
                  GenerateImplementationVisitor generateImpl)
           throws CoComposeException
Applies the implementation generator.
Overrides:
apply in class JavaImplementationGenerator
Parameters:
implementation - The implementation generator to apply.
generateImpl - The language specific code generation operation visitor.
Throws:
CoComposeException - if generating implementation failed.