implementations
Class ConcernJOverrides

java.lang.Object
  |
  +--implementations.JavaImplementationGenerator
        |
        +--implementations.ConcernJImplementationGenerator
              |
              +--implementations.ConcernJOverrides
All Implemented Interfaces:
ImplementationGeneratorI

public class ConcernJOverrides
extends ConcernJImplementationGenerator

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

Version:
0.1.21, 6 April 2004
Author:
Dennis Wagelaar

Constructor Summary
ConcernJOverrides()
          Constructs a ConcernJOverrides
 
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.ConcernJImplementationGenerator
createFiltermodule, getFiltermoduleName, getRealmImplementation, insertFiltermodule, insertMethodOverrideID, insertParameters, insertReturnType, insertSuperimposition, makeFilterDecl
 
Methods inherited from class implementations.JavaImplementationGenerator
createClause, createMethod, getClasses, getComposite, getConceptsFor, getCurrentImplementation, getCurrentImplementation, getImplGen, getInstanceName, getInterfaces, getModel, getPrimitives, getVisitor, insertExtends, insertImplements, insertImports, insertMethod, insertPrimitiveImplementation, insertPrimitiveImplementations, 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

ConcernJOverrides

public ConcernJOverrides()
Constructs a ConcernJOverrides
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.