implementations
Class JavaSingleInstance

java.lang.Object
  |
  +--implementations.JavaImplementationGenerator
        |
        +--implementations.JavaSingleInstance
All Implemented Interfaces:
ImplementationGeneratorI
Direct Known Subclasses:
JAsCoSingleInstance, SEESCOASingleInstance

public class JavaSingleInstance
extends JavaImplementationGenerator

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

Version:
0.1.17, 18 November 2003
Author:
Dennis Wagelaar

Constructor Summary
JavaSingleInstance()
          Constructs a JavaSingleInstance.
 
Method Summary
 void apply(ImplementationGenerator implementation, GenerateImplementationVisitor generateImpl)
          Applies the implementation generator.
protected  void applyPerOwner()
          Applies the implementation generator for each Owner concept.
protected  void applyToOwner(Concept owner)
          Applies the implementation generator to an Owner concept.
protected  void applyToOwnerClass(Concept owner, Concept propertyC, Concept classC)
          Applies the implementation generator to an Owner concept with form Class.
protected  void applyToOwnerMethod(Concept owner, Concept propertyC, Concept classC)
          Applies the implementation generator to an Owner concept with form Method.
protected  void checkRoles()
          Checks the composite roles for existence.
protected  CompositeRole getClassRole()
          Retrieves the Class role of the composite.
protected  CompositeRole getOwnerRole()
          Retrieves the Owner role of the composite.
protected  CompositeRole getPropertyRole()
          Retrieves the Property 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

JavaSingleInstance

public JavaSingleInstance()
Constructs a JavaSingleInstance.
Method Detail

getOwnerRole

protected CompositeRole getOwnerRole()
Retrieves the Owner role of the composite.
Returns:
The Owner CompositeRole.

getPropertyRole

protected CompositeRole getPropertyRole()
Retrieves the Property role of the composite.
Returns:
The Property CompositeRole.

getClassRole

protected CompositeRole getClassRole()
Retrieves the Class role of the composite.
Returns:
The Class CompositeRole.

checkRoles

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

applyPerOwner

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

applyToOwnerClass

protected void applyToOwnerClass(Concept owner,
                                 Concept propertyC,
                                 Concept classC)
                          throws CoComposeException
Applies the implementation generator to an Owner concept with form Class.
Parameters:
owner - The concept to apply the role part for.
propertyC - The property concept.
classC - The class concept.
Throws:
CoComposeException - if generating implementation failed.

applyToOwnerMethod

protected void applyToOwnerMethod(Concept owner,
                                  Concept propertyC,
                                  Concept classC)
                           throws CoComposeException
Applies the implementation generator to an Owner concept with form Method.
Parameters:
owner - The concept to apply the role part for.
propertyC - The property concept.
classC - The class concept.
Throws:
CoComposeException - if generating implementation failed.

applyToOwner

protected void applyToOwner(Concept owner)
                     throws CoComposeException
Applies the implementation generator to an Owner concept.
Parameters:
owner - The concept to apply the role part for.
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.