implementations
Class JavaReturns

java.lang.Object
  |
  +--implementations.JavaImplementationGenerator
        |
        +--implementations.JavaReturns
All Implemented Interfaces:
ImplementationGeneratorI
Direct Known Subclasses:
SEESCOAReturns

public class JavaReturns
extends JavaImplementationGenerator

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

Version:
0.1.06, 4 February 2003
Author:
Dennis Wagelaar

Constructor Summary
JavaReturns()
          Constructs a JavaReturns
 
Method Summary
 void apply(ImplementationGenerator implementation, GenerateImplementationVisitor generateImpl)
          Applies the implementation generator.
protected  void applyPerOriginator()
          Applies the implementation generator for each Originator concept.
protected  void applyToOriginator(Concept originator, java.util.Collection results)
          Applies the implementation generator to an Originator concept.
protected  void checkResultsCount(java.util.Collection results)
          Checks whether the amount of Result concepts doesn't exceed 1.
PRE: results ::= Collectio<Concept>
protected  void checkRoles()
          Checks the composite roles for existence.
protected  CompositeRole getOriginatorRole()
          Retrieves the Originator role of the composite.
protected  CompositeRole getResultRole()
          Retrieves the Result 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

JavaReturns

public JavaReturns()
Constructs a JavaReturns
Method Detail

getOriginatorRole

protected CompositeRole getOriginatorRole()
Retrieves the Originator role of the composite.
Returns:
The Originator CompositeRole.

getResultRole

protected CompositeRole getResultRole()
Retrieves the Result role of the composite.
Returns:
The Result CompositeRole.

checkRoles

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

applyPerOriginator

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

checkResultsCount

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

applyToOriginator

protected void applyToOriginator(Concept originator,
                                 java.util.Collection results)
                          throws CoComposeException
Applies the implementation generator to an Originator concept.
Parameters:
originator - The concept to apply the role part for.
results - The set of result 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.